Article View: alt.privacy.anon-server
Article #283458Re: Problem with mixmaster init.d script
From: Jeremy Bentham
Date: Sun, 17 Jul 2016 02:13
Date: Sun, 17 Jul 2016 02:13
105 lines
2724 bytes
2724 bytes
> Every time I try to run this auto start script, if gets this error:
>
> Detaching.
> Could not open pidfile for readwrite: Permission denied
> Aborting.
>
> The problem is that it changes the mixmaster.pid file ownership to root:root. Does anyonec see a way around this:
>
> Script:
>
> #!/bin/sh
> ### name = mixmaster
>
> dir="/home/mix/Mix"
> cmd="./mixmaster -D"
> user="mix"
>
> name=`basename $0`
> pid_file="$dir/$name.pid"
>
> #VERBOSE=0
> #BASEDIR="/home/$user/Mix"
> #MIXEXE="$BASEDIR/mixmaster"
>
> stdout_log="/var/log/$name.log"
> stderr_log="/var/log/$name.err"
>
>
> get_pid() {
> cat "$pid_file"
> }
>
> is_running() {
> }
>
> case "$1" in
> start)
> if is_running; then
> echo "Already started"
> else
> echo "Starting $name"
> cd "$dir"
> sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
> else
> sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
> fi
> echo $! > "$pid_file"
> if ! is_running; then
> echo "Unable to start, see $stdout_log and $stderr_log"
> exit 1
> fi
> fi
> ;;
> stop)
> if is_running; then
> echo -n "Stopping $name.."
> kill `get_pid`
> for i in {1..10}
> do
> if ! is_running; then
> break
> fi
>
> echo -n "."
> sleep 1
> done
> echo
>
> if is_running; then
> echo "Not stopped; may still be shutting down or shutdown may have failed"
> exit 1
> else
> echo "Stopped"
> rm "$pid_file"
> fi
> fi
> else
> echo "Not running"
> fi
> ;;
> restart)
> $0 stop
> if is_running; then
> echo "Unable to stop, will not attempt to start"
> exit 1
> fi
> $0 start
> ;;
> status)
> if is_running; then
> echo "Running"
> else
> echo "Stopped"
> exit 1
> fi
> ;;
> *)
> echo "Usage: $0 {start|stop|restart|status}"
> exit 1
> ;;
> esac
>
> exit 0
Thank you. Working here too.
Technical Details
Message-ID:
<f1b3eff662dc6c21e79b916678f9d391@anemone.mooo.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mailReferences:
<dcf85fb725e312f809330493f1769051@remailer.privacy.at>Show Full Headers
Complete Article Headers
Message-ID: <f1b3eff662dc6c21e79b916678f9d391@anemone.mooo.com> Subject: Re: Problem with mixmaster init.d script Date: Sun, 17 Jul 2016 02:13:58 +0000 From: Jeremy Bentham <nobody@anemone.mooo.com> References: <dcf85fb725e312f809330493f1769051@remailer.privacy.at> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail Comments: This message did not originate from the Sender address above. It was remailed automatically by anonymizing remailer software. Please report problems or inappropriate use to the remailer administrator at <jeremyadmin@anemone.mooo.com>. Newsgroups: alt.privacy.anon-server Injection-Info: mail2news.mixmin.net; mail-complaints-to=abuse@mixmin.net Lines: 105