Sponsored Content
Operating Systems Linux Need advice on coding a daemon Post 302308487 by Housni on Saturday 18th of April 2009 04:41:08 PM
Old 04-18-2009
Need advice on coding a daemon

I hope this is the right forum to post this.

I need a little advice on something.

I want to create a daemon to run on a Linux server and this daemon should:
1. capture the `./configure` command so that it knows where a program installed via source would store it's binaries and, most importantly, configuration files.
2. somehow capture package manager activity so that it knows where the programs binaries and configuration files are.
3. detect when a service is started or stopped or restarted...basically, detect the change in status of a service. How does Linux know when a service is triggered? Is a /proc file or something like that triggered?

Would a daemon coded in Python work here? Also, what are the best options to capture a commands activity? strace? gdb?

For #1, I thought of just having my program read the bottom of the man's to get the location of the config files but a lot of programs don't have such details man's on Linux :/

My aim is to basically make a little program that self documents so that, for example, if an admin decides to install the latest PHP on a web server, compiled from source since the package manager doesn't have the latest version, my program should save that information to a file somewhere.

Any ideas?
 

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

can I use this coding

I apologise because I had pasted this question in the newbies forum first (because i am a bit of a newbie) but thought it might be better suited in here if i have to sepearate parameters can I use this syntax especially the or part (||) and is this correct if (6 Replies)
Discussion started by: w33man
6 Replies

2. UNIX for Dummies Questions & Answers

pro*c coding

Hi All, I am new to pro*C. I have a select statement as select a.ename,a.sal,a.empno from emp where &n=(select count(distinct(b.sal)) from emp b where a.sal<=b.sal for this query I have to write a pro*C program. So can you please send me the complete code. Then I will foloow the same... (1 Reply)
Discussion started by: user71408
1 Replies

3. Programming

Help for coding this programme

for a floating-point array x whose size is n, find the geometric mean.. GM =n x1.x2.x3...xn (2 Replies)
Discussion started by: allyjaah
2 Replies

4. Shell Programming and Scripting

Coding in Phyton

I have the following Phyton script and want to print something if the option was selected For example if the user uses --npop=12, I want to check if the user has inputted --npop and do if npop selected, print npop Or if the user puts --fdata=npt02.dat I print something like if fdata... (3 Replies)
Discussion started by: kristinu
3 Replies

5. Shell Programming and Scripting

Need help with coding

HI, Can some one guide me how to make changes to the script below so that it can load the history of a program to IT server ? Format of data: YYYYMMDD065959.dsk.log YYYYMMDD235959.dsk.log currently both are loaded together. Need to separate them as above format. Thanks in advance. ... (1 Reply)
Discussion started by: crazydude80
1 Replies

6. Windows & DOS: Issues & Discussions

Need help with coding

HI, Can some one guide me how to make changes to the script below so that it can load the history of a program to IT server ? Format of data: YYYYMMDD065959.dsk.log YYYYMMDD235959.dsk.log currently both are loaded together. Need to separate them as above format. Thanks in advance. ... (2 Replies)
Discussion started by: crazydude80
2 Replies
avahi-daemon(8) 					      System Manager's Manual						   avahi-daemon(8)

NAME
avahi-daemon - The Avahi mDNS/DNS-SD daemon SYNOPSIS
avahi-daemon [options] avahi-daemon --kill avahi-daemon --reload avahi-daemon --check DESCRIPTION
The Avahi mDNS/DNS-SD daemon implements Apple's Zeroconf architecture (also known as "Rendezvous" or "Bonjour"). The daemon registers local IP addresses and static services using mDNS/DNS-SD and provides two IPC APIs for local programs to make use of the mDNS record cache the avahi-daemon maintains. First there is the so called "simple protocol" which is used exclusively by avahi-dnsconfd (a daemon which config- ures unicast DNS servers using server info published via mDNS) and nss-mdns (a libc NSS plugin, providing name resolution via mDNS). Finally there is the D-Bus interface which provides a rich object oriented interface to D-Bus enabled applications. Upon startup avahi-daemon interprets its configuration file /etc/avahi/avahi-daemon.conf and reads XML fragments from /etc/avahi/ser- vices/*.service which may define static DNS-SD services. If you enable publish-resolv-conf-dns-servers in avahi-daemon.conf the file /etc/resolv.conf will be read, too. OPTIONS
-f | --file= FILE Specify the configuration file to read. (default: /etc/avahi/avahi-daemon.conf) -D | --daemonize Daemonize after startup. Implies --syslog. -s | --syslog Log to syslog instead of STDERR. Implied by --daemonize. --debug Increase verbosity to debug level. --no-rlimits Don't enforce resource limits as specified in the configuration file. (See setrlimit(2) for more information) --no-drop-root Don't drop root privileges after startup and don't require daemon to be started as root. We recommend not to use this option. --no-chroot Don't chroot(2) the daemon. This option is only available when compiled with chroot() support. --no-proc-title Don't change the process name while running. Unless this option is specified avahi-daemon will reflect its current state and the selected host name in the process title. -k | --kill Kill an already running avahi-daemon. (equivalent to sending a SIGTERM) -r | --reload Tell an already running avahi-daemon to reread /etc/resolv.conf (in case you enabled publish-resolv-conf-dns-servers in avahi-dae- mon.conf) the files from /etc/avahi/services/. Please note that this will not reload the /etc/avahi/avahi-daemon.conf. (equivalent to sending a SIGHUP) -c | --check Return 0 as return code when avahi-daemon is already running. -h | --help Show help -v | --version Show version information FILES
/etc/avahi/avahi-daemon.conf: the default configuration file for avahi-daemon, avahi-daemon.conf(5) for more information. /etc/avahi/hosts: additional static hostname mappings to publish in mDNS, see avahi.hosts(5) for more information. /etc/avahi/services/*.service: static service definitions, see avahi.service(5) for more information. SIGNALS
SIGINT, SIGTERM: avahi-daemon will shutdown. (Same as --kill). SIGHUP: avahi-daemon will reload unicast DNS server data from /etc/resolv.conf and static service definitions from /etc/avahi/services/. (Same as --reload) SIGUSR1: avahi-daemon will dump local and remote cached resource record data to syslog. AUTHORS
The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from http://avahi.org/ SEE ALSO
avahi-daemon.conf(5), avahi.hosts(5), avahi.service(5), avahi-dnsconfd(8), avahi-set-host-name(1) http://avahi.org/wiki/AvahiAndUnicastDotLocal documents the problems when using Avahi in a unicast DNS zone .local. COMMENTS
This man page was written using xml2man(1) by Oliver Kurth. Manuals User avahi-daemon(8)
All times are GMT -4. The time now is 11:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy