you have created a daemon called mydaemon that performs data

you have created a daemon called mydaemon that performs database management tasks on the system however, you want to have this daemon start only on runlevel 5. this daemon should not exist in memory when the system is in any other runlevel. in which directory should you place this daemon? what links to this daemon should you create? write the commands you would use to have this daemon start and stop automatically on the system.      [Linux Admin]

Solution

a) The script should be placed in /etc/init.d directory to start,stop and restart \'mydaemon\'.
b) The links should be created to start the daemon in runlevel 5 and stop the daemon in remaining runlevels 0, 1, 2, 3, 4, 6;
commands to perform this:
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc5.d/S50mydaemon
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc0.d/K50mydaemon
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc1.d/K50mydaemon
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc2.d/K50mydaemon
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc3.d/K50mydaemon
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc4.d/K50mydaemon
ln –s /etc/rc.d/init.d/mydaemon /etc/rc.d/rc6.d/K50mydaemon

you have created a daemon called mydaemon that performs database management tasks on the system however, you want to have this daemon start only on runlevel 5.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site