Hello, where i can put a executable to make it daemon

John H. Robinson, IV jaqque at ucsd.edu
Mon Aug 28 13:22:58 PDT 2000


On Mon, Aug 28, 2000 at 12:50:57PM -0700, vikas aggarwal wrote:
> I have my own executable , which needs to run like windows services.
> I checked in the README file in /etc/init.d
> It seems that it won't be just adding a line with arguments in a config. 
> file.
> What all i need to modify, do i need to craete my own rc? directory ??

okay.  your program/script can live ANYWHERE you like - as long as that
location is available at the time you wish the daemon to start.

(ie: /bin, /sbin, /usr/bin, /usr/local/bin, $HOME/bin) ANYWHERE.
there are some standard locations, but those depend upon the nature of
your script/program

(since this is solaris, you are free to ignore this link but i offer it
anyway:)

Filesystem Hierarchy Standard
http://www.pathname.com/fhs/


now all you need to do is to invoke it.

since this is solaris, i would suggest writing a simple wrapper script
such as:

---- Cut here! ----
#!/bin/sh

case "$1" in

start)
	/usr/loca/bin/proggie -flags options
	;;

stop)
	;;
*)
	echo "Usage: $0 start|stop"
	;;

esac
---- Cut here! ----

put that into /etc/init.d, (name it local, or my-proggie or something
unlike anything already in there. try to make it unique, so any future
Solaris updates do not destroy it. you might try a convention like 
username_proggyname such as: jaqque_egd)

then create a hard link (you could use a symlink, but Solaris uses
hardlinks and no real reason to stray far from that convention) to the
rc.d directory of your choice (chose 2)

# ln /etc/init.d/newscript /etc/rc2.d/S99newscript

this way at boot time, it will start automatically.

now the REAL nice thing is to make the links to the rc1.d and rc0.d:

# ln /etc/init.d/newscript rc0.d/K99newscript
# ln /etc/init.d/newscript rc1.d/K99newscript

(note the K - this means kill)

for more information, find a good reference on SysV init.

-john

note: i have no idea what your daemon is, what it does, or what it's
purpose is. so if this does not work for you, give us more details and
we will do what we can - standard disclaimers apply.  oo - better add
mine:

-- 
John H. Robinson, IV          jhriv at ucsd.edu                 www.  ((((
                                                             nyx. ( )(:[
WARNING: I cannot be held responsible for the above,         org/  ((((
as apparently my cats have learned how to type.              spiders.htm



More information about the KPLUG-List mailing list