Page 1 of 1

Tonido.sh Script Functionality Broken

Posted: Mon Aug 20, 2018 4:03 pm
by Nicho
Hi all,

I'm currently running Tonido on my headless Ubuntu server (16.04.5 LTS) to manage my network shares. I set it up with the Tonido.sh start script in my rc.local file using Steel's suggestion in this topic to run on start every time I boot the server, which works fine.

However, I'm running into a problem with the rest of the script. Specifically, when I try to use "/path/to/tonido/tonido.sh stop", I'm given the following output:

Code: Select all

nick@Gemini:~$ /usr/local/tonido/tonido.sh stop
Stopping Tonido Service: tonidoconsole.
cat: /tmp/tonido_nick.pid: No such file or directory
/usr/local/tonido/tonido.sh: 32: kill: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]


Weirdly, when I try to re-run tonido.sh start (even though the service is already running) and then tonido.sh stop, the output changes to the following:

Code: Select all

nick@Gemini:~$ /usr/local/tonido/tonido.sh start
Starting Tonido Service:nick@Gemini:~$ nohup: redirecting stderr to stdout
^C
nick@Gemini:~$ /usr/local/tonido/tonido.sh stop
Stopping Tonido Service: tonidoconsole.
/usr/local/tonido/tonido.sh: 32: kill: No such process


I have already tried fixing the script using rt006's fix mentioned in the above thread:

rt006 wrote:I just want to offer some input on running Tonido on Ubuntu Server.

First, the tonido.sh script included in the package has a bug that breaks the stop and restart commands. To fix it, look for the line that reads

Code: Select all

kill -9 `cat  $PIDFILE` &> /dev/null
and change it to

Code: Select all

kill -9 `cat  $PIDFILE` > /dev/null


I tried reverting the script back to its original form without that fix, but then the stop script does nothing at all. So, that's where I'm at. Any help would be greatly appreciated.

Re: Tonido.sh Script Functionality Broken

Posted: Mon Aug 20, 2018 4:27 pm
by rt006
cat: /tmp/tonido_nick.pid: No such file or directory

It looks like the file that's meant to keep track of the process ID is missing.

Re: Tonido.sh Script Functionality Broken

Posted: Tue Aug 21, 2018 7:13 am
by Nicho
Yeah, that's what I was figuring too. The weird part is, even with the .pid missing, the Tonido service still runs fine. Then when I run tonido.sh start (with the service already running), it changes to output of the tonido.sh stop script to what I wrote above. Maybe running the start script on boot isn't generating a file which re-running the script does generate? But I'm pretty sure anything running from rc.local should have write permissions to the /tmp directory, which is where the script is looking for that .pid file. Plus, I don't know why it errors out with the "No such process" warning when I try it the second time.

This is hurting the functionality of my Tonido server because I'm trying to run tonido.sh restart as a cron job every night, since Tonido has been crashing on me lately and I'd like to make sure it stays up.

Re: Tonido.sh Script Functionality Broken

Posted: Tue Aug 21, 2018 10:27 am
by rt006
even with the .pid missing, the Tonido service still runs fine

The service doesn't depend on the PID file. It's the script that wants to record the process ID, so it can kill it when you issue a stop or a restart.

Maybe running the start script on boot isn't generating a file which re-running the script does generate?

Seems likely.

I don't know why it errors out with the "No such process" warning when I try it the second time.

I'm guessing the script is issuing a 'kill' on a nonexistent process.

Have you tried using systemd instead of rc.local?