Welcome, Guest. Please login or register.
April 21, 2014, 10:29:37 AM
Home Help Search Calendar Login Register
Show unread posts since last visit.
News: Let Pardus-Anka become #1: Pardus-Anka Bug ReportPardus-Anka World Google+ | The Pardus wiki  | Visit Pardus-Anka official website  | Register as forum member?  Email the moderator!

+  Pardus Worldforum
|-+  Assistance
| |-+  Pardus for beginners
| | |-+  Pardus init system
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Pardus init system  (Read 2041 times)
Lloyd De Jongh
Newbie
*
Gender: Male
Posts: 23


View Profile
« on: September 13, 2007, 19:48:15 PM »

Hi guys

I come from a RedHat Linux (and Solaris Cool background. I currently work with Centos 5, to provide a point of reference. Let it be known that I do not enjoy RPM.

I gather that the init scripts (service.py) for each daemon resides in

"/var/lib/pisi/package/<package name>/comar/service.py"

directory. Assuming that is correct, how do I easily start and stop services from the command line? I am aware that Pardus is desktop-focused, however I typically SSH into a box, using the command line only. I rarely need or use a desktop/VNC connection.

With other Linuxes one could predictably expect to use

"/etc/init.d/<service> start|stop|status

With Pardus, the service.py is scattered throughout the package folders.IS there another mechanism I am not aware of, can these packages be reliably symlinked to /etc/init.d, and 3rd, will the upcoming server distro take a different approach?

I have never help onto a copy of any desktop Linux for very long, but Pardus seems to be sticking around. I like the implementation and of course once you like something you think of putting it on the server. However, I need to know this (and other) answers before I can trust what I'm doing.

Regards

Lloyd
Logged

"In theory, there is no difference between theory and practice. But, in practice, there is." -- Jan L.A. van de Snepscheut
Lloyd De Jongh
Newbie
*
Gender: Male
Posts: 23


View Profile
« Reply #1 on: September 13, 2007, 20:00:09 PM »

Ok, five minutes of playing around and I found my answer

service comar start
service openssh status

I got that more or less figured out. I guess I'm old school and like my /etc/init.d/

My issue with the service command is that sometimes you're not sure of the name of the daemon, and you can't tab complete like you can when referencing a file in a directory. When you spend A LOT of time tapping away in a console it makes a world of difference.



Logged

"In theory, there is no difference between theory and practice. But, in practice, there is." -- Jan L.A. van de Snepscheut
Eren.Turkay
Global Moderator
Pardus Master
*****
Posts: 262



View Profile WWW
« Reply #2 on: September 13, 2007, 20:03:56 PM »

You can use "service" command from console to stop, start, re-start services or see status of it Wink) And also you can auto-start service while booting with this utility, just read options via;

service --help

* start the service: service X start
* stop the service: service X stop
* restart the service: service X restart

* list services: service list

* make service started at boot: service X on
* make service isn't started at boot: service X off
Logged
Lloyd De Jongh
Newbie
*
Gender: Male
Posts: 23


View Profile
« Reply #3 on: September 13, 2007, 20:07:40 PM »

;-)

Thanks Eren, but I beat you to it. LOL!!

Yeah, I just checked out service --help and saw that you could enable a boot-time start, or disable, using the command. Nice.

Like RH's chkconfig command, but this seems much simpler and easier to use.

Is there any plan to use a central directory like /etc/init.d/ just to make things easier for keyboard jocks?

Can we symlink to common services? Especially when testing stuff and messing around it makes life easier.
Logged

"In theory, there is no difference between theory and practice. But, in practice, there is." -- Jan L.A. van de Snepscheut
Eren.Turkay
Global Moderator
Pardus Master
*****
Posts: 262



View Profile WWW
« Reply #4 on: September 13, 2007, 20:08:05 PM »

My issue with the service command is that sometimes you're not sure of the name of the daemon, and you can't tab complete like you can when referencing a file in a directory. When you spend A LOT of time tapping away in a console it makes a world of difference.

Please install "bash-completion" package, you can use TAB for programs' options. Just write "service a" and press TAB, see available services Wink Also you can use it for pisi's options.
Logged
Lloyd De Jongh
Newbie
*
Gender: Male
Posts: 23


View Profile
« Reply #5 on: September 13, 2007, 20:12:26 PM »

Please install "bash-completion" package, you can use TAB for programs' options. Just write "service a" and press TAB, see available services Wink Also you can use it for pisi's options.

You guys are geniuses Wink

I've done that and it works well, it's just a little on the slow side. It does save having to type out a full path, that saves a few keystrokes.

Thanks, I just learned something. I like the approach you guys have taken to this OS.

 

« Last Edit: September 13, 2007, 20:17:20 PM by Lloyd De Jongh » Logged

"In theory, there is no difference between theory and practice. But, in practice, there is." -- Jan L.A. van de Snepscheut
Lloyd De Jongh
Newbie
*
Gender: Male
Posts: 23


View Profile
« Reply #6 on: September 15, 2007, 07:22:55 AM »

Hi guys

I rewrote a sample XML service.py script using vncserver as a test program. Playing around, even blind alleys, can be useful for learning the deeper ins and outs of a system

RH has an /etc/sysconfig/vncservers file that can be edited to create VNC user sessions that are available from boot time. I can't find such a config file in Pardus, hence my attempt to start VNC as a service.

This is my (incomplete) file below:


#!/usr/bin/python
# -*- coding: utf-8 -*-

from comar.service import *

serviceType = "server"
serviceDesc = _({"en": "VNC Server"})

@synchronized
def start():
        startService(command="/usr/bin/vncserver",
                args="-geometry 800x600 :1",
                                        donotify=True)

        @synchronized
        def stop():
                stopService(command="/usr/bin/vncserver",
                args="-kill :1",
                                        donotify=True)

                def status():
                        return isServiceRunning(command="/usr/bin/vncserver")


I have registered it with comar.

Now when I run service vnc start I receive this error:
vnc error: Unable to start: vncserver: The USER environment variable is not set

service vnc stop:
Service doesn't provide this operation

How do I go about editing the file to get the right results?

Logged

"In theory, there is no difference between theory and practice. But, in practice, there is." -- Jan L.A. van de Snepscheut
yosefm
Newbie
*
Posts: 7


View Profile
« Reply #7 on: September 22, 2007, 15:39:26 PM »

I don't know about starting, but the stopping problem may come from an indentation problem: in the code you posted, stop() is indented to the level of start(), which makes it a local function in start() instead of a file-levvel function.
Logged
Lloyd De Jongh
Newbie
*
Gender: Male
Posts: 23


View Profile
« Reply #8 on: September 22, 2007, 17:07:54 PM »

Thanks for the update  Wink

I am NO coder, I have the equivalent of a blunt crayon and a scrap of paper when it comes to code. I'll play with it and see what happens, but that may well be my problem as you pointed out.

Logged

"In theory, there is no difference between theory and practice. But, in practice, there is." -- Jan L.A. van de Snepscheut
Pages: [1] Go Up Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!