11-25-2004, 03:45 AM
Registered: Feb 2004
Location: Gulfport, MS
Distribution: Slackware 10.1, Gentoo
How do I add start and stop commands to systems startup and shutdown processes?
I installed hpoj but after installing it informed me that I would need to configure ptal-init to start at bootup. Since slack doesnt use SysV-init scripts the install script couldnt do it.
If your system uses SysV-style init scripts:
cd into either /etc/init.d or /etc/rc.d/init.d.
Ensure that ptal-init is in this directory. It may be an actual file or a symlink to somewhere else. Also, some package providers may call it something else, such as hpoj or ptal. If you don't find it here, then look for it where you installed hpoj (such as /usr/local/sbin/ptal-init). Use this file in place of "../init.d/ptal-init" below.
Run "ls -ld /etc/rc.d/rc*.d /etc/rc*.d" to look for all of the runlevel init script directories. Some entries may be symlinks to other directories.
For each runlevel init script directory (not symlink) that you find:
cd into that directory.
Look for a symlink with a name of the form "S<nn><module>" or "K<nn><module>", where <nn> is a number indicating the order in which things are [S]tarted or [K]illed, and <module> is the name of your print spooler, probably either lpd or cupsd.
If you find a symlink to [S]tart your print spooler, then create a [S]tart symlink for ptal-init with a start-order number one less than that for your print spooler. For example, if you found S60lpd, then issue a command such as "ln -s ../init.d/ptal-init S59ptal-init".
If you find a symlink to [K]ill your print spooler, then create a [K]ill symlink for ptal-init with a kill-order number one greater than that for your print spooler. For example, if you found K60lpd, then issue a command such as "ln -s ../init.d/ptal-init K61ptal-init".
If your system doesn't use SysV-style init scripts, then consult your distribution's documentation for information on how to add additional start and stop commands to your system's startup and shutdown processes. If all else fails, you might be able to add a line to some sort of "local" init script, such as /etc/rc.d/rc.local, that invokes "ptal-init start", but this will likely not guarantee that "ptal-init start" is run before your print spooler. Also, you'll probably need to specify the full path to ptal-init in this case.
How can I setup so ptal-init process starts?