start-stop-daemon in Slackware?
Hi,
I have an init scripts that uses start-stop-daemon but Slackware 13.37 does not have it. How can I emulate it or install it? Thanks, Carlos |
From what distribution is that script originally for? What does it need to actually do to start up whatever it is starting?
I don't know if there is such a thing independently made for Slackware. Ordinarily, if you need to do things that way, you need to do it all that way, and thus need to run another distribution instead (to avoid all the manual rewrites you'd have to do that effectively morph Slackware into something else). If you want to stick with Slackware, just rewrite the script to literally do on its own everything that needs to be done. This is how things used to be, anyway before all these new fangled toys made life more complicated, and systems harder to debug. |
Using the files you'll find in /etc/rc.d as a model rewrite your script(s) to look the same. Save the rewritten script in /etc/rc.d as "rc.whatever" (where "whatever" is the name of the daemon you're trying to control), make it executable (chmod 755 /etc/rc.d/rc.whatever and add the name to /etc/rc.local in this form (this is /etc/rc.d/rc.httpd, it should give you the idea of what to do using your own daemon name and path settings):
Code:
#!/bin/sh In /etc/rc.local: Code:
# Start whatever Code:
# Stop whatever Hope this helps some. |
1 Attachment(s)
Hi,
This is the original script: Code:
start() { I uploaded the file so you can see the whole thing. Many thanks in advance. |
The script is sourcing /lib/lsb/init-functions, I can only guess that the functions log_daemon_msg, start-stop-daemon and log_end_msg are defined there.
What I would do in your case is get /lib/lsb/init-functions from the distro this script come from, study what the functions do exactly, and then write my own Slackware script as tronayne suggests. It seems that log_daemon_msg logs messages to the file activemq, log_end_msg is also related to logging. The function start-stop-daemon is the one that starts/stops the daemon, using parameters --start and --stop. But once again, I'm just guessing without actually seeing what /lib/lsb/init-functions does. |
Quote:
Code:
#!/bin/sh |
Quote:
A script like Woodsman's will be fine -- IF the process is meant to run as root, or if the binary you are starting changes its own UID (like mysql, I think, though I don't have the start scripts handy). However, for something like this, which is designed to be run as a non-root non-interactive user and does not change its own UID upon running, start-stop-daemon or something like it is a very good idea. [edit]daemonize should also work, FYI -- but there is no SlackBuild or package for either that I know of, so you'll have to roll your own.[/edit] |
All times are GMT -5. The time now is 03:02 PM. |