You are not logged in.
Pages: 1
Hello,
I switched my server vom debian to arch during last week. The server has a special RAID-Controller (3ware 9650 SE) with a special maintaince-Applikation.
For this application I want to make a arch-package. The app runs normally as a deamon. Under debian I modified a sample init-script and it works
But in arch-linux I can't find any sample init-script, which I can modify. The rc.d folder contains some scripts but they all different and seems to be very complicated
Has anybody a simple init-script, to start, stop and restart a small application?
Thanks for help
Greetings,
Flasher
Offline
Hi Flasher,
if i get it right, your app will run as a deamon ? Yes - so why not simply create a script inside /etc/rc.d ?
An example script:
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
PID=`pidof -o %PPID /usr/bin/"YOURAPP"`
case "$1" in
start)
stat_busy "Starting "YOURAPP" Daemon"
[ -z "$PID" ] && /usr/bin/"YOURAPP" &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/"YOURAPP" .pid
add_daemon "YOURAPP"
stat_done
fi
;;
stop)
stat_busy "Stopping "YOURAPP" Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/"YOURAPP" .pid
rm_daemon "YOURAPP"
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
Modifi this file for your needs and save it as ""YOURAPP"; make the file executable and have fun ;-)
Hope this helps ?
Best regards,
Tobi
--
Tobias 'tri' Richter
Visit me at: http://opt.imi.st
Offline
Thank you very much!
Da du auch deutsch sprichst ;-) Genau das habe ich gebraucht! Ich hab mich wohl mit dieser deamon Angelegenheit etwas umständlich ausgedrückt!
Danke!
Güße,
Flasher
Offline
Pages: 1