Quote:
Originariamente inviato da kappa85
e quindi? come lo faccio funzionare?
|
Ti do uno skull per i sistemi debian-like (forse va bene anche su ubuntu):
Codice:
#!/bin/bash
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting xyz..." ""
# Avviare qui il programma, ad es. con start-stop-daemon
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping xyz..." ""
# Arrestare qui il programma, ad es. con start-stop-daemon
log_end_msg $?
;;
restart)
"$0" stop
"$0" start
;;
*)
echo "Syntax: $0 start|stop|restart"
exit 1
;;
esac
exit 0
Nota che se il programma che devi lanciare č _bloccante_, puoi usare start-stop-daemon con l'opzione -b.
Vedi anche l'esempio /etc/init.d/skeleton
__________________
0: or %edi, %ecx; adc %eax, (%edx); popf; je 0b-22; pop %ebx; fadds 0x56(%ecx); lds 0x56(%ebx), %esp; mov %al, %al
andeqs pc, r1, #147456; blpl 0xff8dd280; ldrgtb r4, [r6, #-472]; addgt r5, r8, r3, ror #12
|