16/09/2010, 08:31:53
Perso, je me suis fait un script pour init.d.
Au contraire, je suis sous fedora, il faudra peut être donc l'adapter.
Si çà peut aider...
#!/bin/bash
#
# eib: Starts the Name Switch Cache Daemon
#
# chkconfig: - 30 74
# description: This is a daemon which handles passwd and group lookups \
# for running programs and cache the results for the next \
# query. You should start this daemon if you use \
# slow naming services like NIS, NIS+, LDAP, or hesiod.
# processname: /usr/local/bin/eibnetmux
# config: /etc/sysconfig/eib
#
### BEGIN INIT INFO
# Provides: eib
# Required-Start: $syslog
# Default-Stop: 0 1 6
# Short-Description: Starts the Name Switch Cache Daemon
# Description: This is a daemon which handles passwd and group lookups \
# for running programs and cache the results for the next \
# query. You should start this daemon if you use \
# slow naming services like NIS, NIS+, LDAP, or hesiod.
### END INIT INFO
# Sanity checks.
[ -x /usr/local/bin/eibnetmux ] || exit 0
# Source function library.
. /etc/init.d/functions
# Source an auxiliary options file if we have one, and pick up NSCD_OPTIONS.
[ -r /etc/sysconfig/eib ] && . /etc/sysconfig/eib
RETVAL=0
progmux=eibnetmux
progtrace=eibtrace
start () {
[ -d /var/run/eib ] || mkdir /var/run/eib
echo -n $"Starting $progmux: "
daemon /usr/local/bin/eibnetmux -s -t -u -e -d 192.168.254.50
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/eibnetmux
echo -n $"Starting $progtrace: "
daemon /usr/local/bin/eibtrace 192.168.254.1
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/eibtrace
echo -n $"Starting linknx: "
daemon /usr/bin/linknx --config=/etc/linknx.xml -d
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/linknx
return $RETVAL
}
stop () {
echo -n $"Stopping $progmux: "
killall eibtrace
success $"$prog shutdown"
echo -n $"Stopping $progtrace: "
killall eibnetmux
echo -n $"Stopping linknx: "
killall linknx
rm -f /var/lock/subsys/eib
success $"$prog shutdown"
echo
return $RETVAL
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
status)
status eibtrace
status eibnetmux
RETVAL=$?
;;
restart)
restart
RETVAL=$?
;;
try-restart | condrestart)
[ -e /var/lock/subsys/nscd ] && restart
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
RETVAL=1
;;
esac
exit $RETVAL
Le 15/09/2010 23:49, Frédéric a écrit :
> On mercredi 15 septembre 2010, chitloft wrote:
>
>> je cherche a lancer automatiquement au démarrage de ma vm ubuntu les
>> commandes eibd et linknx. pourriez vous me dire comment vous faites ?
>> voici ce que je dois taper.
>> eibd -t1023 -i usb:1:2:1:0
>> linknx -c/var/www/knxweb/linknx.xml
>>
>> j'étais parti sur la base du /etc./init.d/skeleton, mais je n'y arrive
>> pas a implemeter correctement le chargement. qq1 l'a t il deja
>> implémenté ou bien passez vous par autre chose ?
> Je lance les services de ce genre via la crontab :
>
> @reboot<chemin_absolu_vers_script>
>
> man crontab pour plus d'infos.
>
Au contraire, je suis sous fedora, il faudra peut être donc l'adapter.
Si çà peut aider...
#!/bin/bash
#
# eib: Starts the Name Switch Cache Daemon
#
# chkconfig: - 30 74
# description: This is a daemon which handles passwd and group lookups \
# for running programs and cache the results for the next \
# query. You should start this daemon if you use \
# slow naming services like NIS, NIS+, LDAP, or hesiod.
# processname: /usr/local/bin/eibnetmux
# config: /etc/sysconfig/eib
#
### BEGIN INIT INFO
# Provides: eib
# Required-Start: $syslog
# Default-Stop: 0 1 6
# Short-Description: Starts the Name Switch Cache Daemon
# Description: This is a daemon which handles passwd and group lookups \
# for running programs and cache the results for the next \
# query. You should start this daemon if you use \
# slow naming services like NIS, NIS+, LDAP, or hesiod.
### END INIT INFO
# Sanity checks.
[ -x /usr/local/bin/eibnetmux ] || exit 0
# Source function library.
. /etc/init.d/functions
# Source an auxiliary options file if we have one, and pick up NSCD_OPTIONS.
[ -r /etc/sysconfig/eib ] && . /etc/sysconfig/eib
RETVAL=0
progmux=eibnetmux
progtrace=eibtrace
start () {
[ -d /var/run/eib ] || mkdir /var/run/eib
echo -n $"Starting $progmux: "
daemon /usr/local/bin/eibnetmux -s -t -u -e -d 192.168.254.50
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/eibnetmux
echo -n $"Starting $progtrace: "
daemon /usr/local/bin/eibtrace 192.168.254.1
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/eibtrace
echo -n $"Starting linknx: "
daemon /usr/bin/linknx --config=/etc/linknx.xml -d
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/linknx
return $RETVAL
}
stop () {
echo -n $"Stopping $progmux: "
killall eibtrace
success $"$prog shutdown"
echo -n $"Stopping $progtrace: "
killall eibnetmux
echo -n $"Stopping linknx: "
killall linknx
rm -f /var/lock/subsys/eib
success $"$prog shutdown"
echo
return $RETVAL
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
status)
status eibtrace
status eibnetmux
RETVAL=$?
;;
restart)
restart
RETVAL=$?
;;
try-restart | condrestart)
[ -e /var/lock/subsys/nscd ] && restart
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
RETVAL=1
;;
esac
exit $RETVAL
Le 15/09/2010 23:49, Frédéric a écrit :
> On mercredi 15 septembre 2010, chitloft wrote:
>
>> je cherche a lancer automatiquement au démarrage de ma vm ubuntu les
>> commandes eibd et linknx. pourriez vous me dire comment vous faites ?
>> voici ce que je dois taper.
>> eibd -t1023 -i usb:1:2:1:0
>> linknx -c/var/www/knxweb/linknx.xml
>>
>> j'étais parti sur la base du /etc./init.d/skeleton, mais je n'y arrive
>> pas a implemeter correctement le chargement. qq1 l'a t il deja
>> implémenté ou bien passez vous par autre chose ?
> Je lance les services de ce genre via la crontab :
>
> @reboot<chemin_absolu_vers_script>
>
> man crontab pour plus d'infos.
>