You are not logged in.

#1 2008-03-05 11:45:36

ndlarsen
Member
From: Denmark
Registered: 2005-11-02
Posts: 157

Daemon control

Hi.

I've made a python script, mainly as a learning experience and for my own convenience. I'm releasing it to the AL community, hoping that others can benefit from it as well as hoping that I would get some sort of feedback on it.
I've named it Arch Linux Daemon Control (aldc). If anyone has any objections on this, please let me know and I'll change it.
So far, aldc has following features. It can list all, stopped or running daemons. Start, stop, restart one or more daemons and provide the status of one or more daemons. Command line syntax is "aldc command parameter", where command is either list, start, stop, restart or status and parameter, in the case of command being list, is either all, stopped or running. In the cases of command being either start, stop, restart and status, parameter is a daemon or a seies of daemons provided as string of daemons separated by commas.
Examples:

aldc list running - will return all running daemons.
aldc stop crond,fam,dbus - will stop crond, fam and dbus daemons.
aldc status dbus,network - will return the status of dbus and network daemons.

Source and pkg are available at
Thank you


I made it long
as I lacked the time to make it short...

Offline

#2 2008-03-05 12:50:26

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: Daemon control

An idea to your project. Can you implement a search on running daemons, which have been upgraded by pacman after daemon was started?

Offline

#3 2008-03-05 18:02:56

ndlarsen
Member
From: Denmark
Registered: 2005-11-02
Posts: 157

Re: Daemon control

Purch wrote:

Can you implement a search on running daemons, which have been upgraded by pacman after daemon was started?

Correct me if I am wrong. As I see it, this would require one of following:

- pacman to somehow tag the daemon as being upgraded, which, IIRC, it currently does not.

- aldc to keep a database of the installed daemons for comparison.

- aldc to mingle with pacman/libalpm, which I have no intentions of.

I cannot really see the benefits of such a feature, enlighten me, please.

Regards.


I made it long
as I lacked the time to make it short...

Offline

#4 2008-03-06 09:10:29

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: Daemon control

Just to know which daemons should be restarted, because they have been upgraded or a dependency of the daemon has been upgraded. Sometimes you just forget to restart upgraded daemons, at least I do.

Compare running daemons to pacman.log?
Maybe take advantage of pacman -Qo (who owns the /etc/rc.d/daemon or the executable in the daemon file).
Check dependencies of the package that includes that daemon file or the daemon executable.
Compare daemon start time (/var/run) to pacgage upgrade time in pacman.log.

Offline

#5 2008-11-23 03:44:31

slipper
Member
Registered: 2008-09-11
Posts: 28

Re: Daemon control

Thanks for this smile

Offline

#6 2008-11-23 13:38:03

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Daemon control

Why use python for this? It seems like a lot of overkill, especially since there are already one or two implementations in bash.

Offline

#7 2008-11-27 06:46:22

Heller_Barde
Member
Registered: 2008-04-01
Posts: 245

Re: Daemon control

@Daenyth:
he said it was mainly an exercise in python and additionally he gives it to us  because he is nice smile

@OP
sounds cool, will try it smile

cheers Barde

Offline

#8 2008-11-27 11:49:50

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Daemon control

Ah, I missed that. Thanks for the addition in any case smile

Offline

Board footer

Powered by FluxBB