Re: SHEL - Konsole wieder haben
ok, hab das so gelöst
export file='//Mai.py'
export pid='/pid.pid'
case "$1" in
start) log_daemon_msg "Starting"
start-stop-daemon --start --quiet --pidfile $pid --name
mailboxer --startas "/usr/bin/python" -- $file &echo $! >$pid
# start-stop-daemon --start --quiet --pidfile /my.pid --name
mailboxer --startas "/home/vavvav/A/sh/MailBoxerPop.py" -- $LSBN
log_end_msg $?
;;
stop) log_daemon_msg "Stopping periodic command scheduler" "crond"
kill `cat $pid`
log_end_msg $?
;;
Es lässt sich starten und anhalten.
Das Problem ist wenn ich die Konsole komplett schließe ist auch der Prozess tot.
Hat jemand Lösungsvorschlage?
Am 25.10.07 schrieb Vladislav Vorobiev <mymir.org@googlemail.com>:
> > IMHO klar, da Du es nicht mit '&' in den Hintergrund schickst.
>
> Ok, so habe ich es natürlich auch versucht.
> Die PID wird dann nicht erstellt und so mit kann man es auch nicht anhalten.
>
> > > Ich habe auch versucht ein init script zu nehmen.
> > >
> > > start) log_daemon_msg "Starting"
> > > start-stop-daemon --start --quiet --pidfile /my.pid --name
> > > mailboxer --startas "python /home/vavvav/A/sh/MailBoxerPop.py" --
> > > $LSBNAMES
> > > log_end_msg $?
> > > ;;
> > > Leider beim starten weiss es nichts mit python anzufangen
> > >
> > > Starting:start-stop-daemon: Unable to start python
> > > /home/vavvav/A/sh/Mail.py: No such file or directory (No such file or
> > > directory)
> > > failed!
> >
> > Was erzaählt denn ein 'which python'?
>
> #!/usr/bin/python
>
> Das habe ich bei dem Python script eingefügt. Es kommt im falle zwei
> zum PermissionDenied, wenn man es ohne python aufruft.
>
> <snip>
> start-stop-daemon --start --quiet --pidfile /my.pid --name
> mailboxer --startas "/home/vavvav/A/sh/Mail.py"
> </snip>
>
> Viele Grüße
> Vlad
>
> --
> Best Regards
> Vlad Vorobiev
> http://www.mymir.org
>
--
Best Regards
Vlad Vorobiev
http://www.mymir.org
Reply to: