Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Hi,
I'm running FFP 0.7 on my Medion NAS (Oxnas based), which works great!
I have a script on the NAS which contains a command that is started with "nohup". Everything works as expected when the script is started locally (in an interactive ssh session), but when I invoke this script from a remote machine with ssh, the nohuped command exits when the script exits.
I've googled for a solution, and tried different suggestions like explicitly redirecting stdout, stderr and stdin in the nohuped command, and invoking ssh with the "-n" option, but nothing works.
Is there anything special about the nohup command included in FFP 0.7 that I should know about?
Regards, Richard
Offline
nohup command 2>&1 & ?
nohup get it up after login, and the final & will put the process in background (without rattachments to tty).
do you use screen ?
Offline
The script I'm invoking via ssh from a remote machine contains, among others, these lines:
nohup cat $INTERFACE > ./heizung.dat 2>./heizung.err </dev/null &
echo $! > seriell_lesen.pid
Which is followed by some more.
The script executes just fine, but when the script exits, the nohuped "cat" command terminates.
When starting the script in a local ssh session, the nohuped "cat" command will survive the logoff.
Offline
Did a little more testing:
The same script when called remotely on my NSLU2 running Debian squeeze (Linux 2.6.32-5-ixp4xx) runs fine, the "cat" command will survive the end of the script and keep on running happily in the background.
I copied the "nohup" command from the Debian distribution over to the NAS to replace ffp's "nohup" in /ffp/bin, but that doesn't help. While the Debian nohup again does what's expected when called from within a shell running on the NAS, it will terminate when the script is called remotely.
I come to the conclusion that the fault must lie within the OS. Probably nothing I can do about it.
Offline
On other platforms I have had problems with using nohup. Sometimes it works, sometimes it doesn't.
My solution is letting the cron daemon start the processes.
I use the following commands to do this:
echo "/full/path/to/command argument1 argument2 > /path/to/stdout.txt 2>/path/to/stderr.txt" | at now
This give the cron a job to start. Then cron will start it immediately in the background. Not attached to the ssh process or even logon shell.
Not sure if this will work for you command.
And you normally aren't able to write the pid into a file.
You could try to write these commands in a script (still using an nohup).
#!/ffp/bin/sh INTERFACE = /path/to/interface nohup cat $INTERFACE > /path/to/heizung.dat 2>/path/to/heizung.err </dev/null & echo $! > /path/to/seriell_lesen.pid
Just change the /path/to to the correct working directories. Add the execute bit to the script and run it like:
echo "/path/to/script.sh >/dev/null 2>&1" | at now
HTH
Offline
I'm feeling terribly stupid
Just looking at the first line of your script suggestion immediately showed me my mistake:
I had copied my script over from a RaspberryPi where /bin/sh is a symbolic link to a "real" shell (/bin/dash).
On my Medion NAS with FFP 0.7, /bin/sh is a symlink to busybox.
I only had to change the shebang path to /ffp/bin/bash (I prefer this over /ffp/bin/sh) and the nohup
is working perfectly when the script is invoked over ssh.
Offline