View Full Version : Problems restarting Girder 6 on Raspberry Pi

May 6th, 2015, 06:50 PM
I'm running Girder 6 on a Raspberry Pi. I can consistently reproduce an odd problem...

Girder starts fine at boot, but:

raspberrypi:~# ps aux |grep -i girder
root 2111 0.4 5.4 200012 25840 ? Sl 18:18 0:04 /opt/girder/Girder6Service
root 2120 0.0 0.2 1696 1276 ? Ss 18:18 0:00 startpar -f -- girder
root 2229 0.0 0.3 3548 1692 pts/0 S+ 18:34 0:00 grep -i girder

note the "startpar -f -- girder" line. I'm not sure what this is, but Girder seems to work just fine. I can connect remotely from Windows and my "Action Tree" is intact.

Whenever I stop and start Girder using the shipped init script, my "Action Tree" is blank. I have to reboot the Pi and all is well again, except for the "startpar -f -- girder" line of ps aux.

I'm running 2015-02-16-raspbian-wheezy with all current updates applied on a model B rev 2.

Any ideas?

May 6th, 2015, 06:56 PM
Could it be restarting under a different user?

May 6th, 2015, 07:06 PM
No, both times it's starting under the root account. The only difference I can see is the "startpar -f -- girder" in the putput of "ps aux".

May 6th, 2015, 07:14 PM
Strange. I have a feeling it does have to do with user/home dir differences. Just for fun add a GML to that empty tree. Then exit Girder. Restart it with the script. Does the GML we just added show up again? I have a feeling it does. Girder is pulling it's data from a different directory,.. my bet is the current user.

May 6th, 2015, 08:02 PM
I've tried that a few times. If I add a new GML to the blank tree and restart Girder, the same "new" tree will repeatedly show after each new restart. However, once I reboot the Pi, the tree is back to the original GML. I hear where you're coming from though, I was wondering the same thing. However the PIDs show root as the owner when started from boot and from restarting Girder after boot manually.

May 6th, 2015, 08:45 PM
May I assume that you are using sudo to start Girder? In that case if you run

sudo echo $HOME

you'll find that you get /home/pi ( or whatever the pi users' home dir is). This is what Girder is using as it's settings dir.

What command do you use to restart Girder? Is it this one:

sudo \etc\init.d\girder start

If not what is it? And please try the command above.

May 6th, 2015, 09:25 PM
Not to sound smug, but I've been a Linux SA off and on for several years, so I understand what you're getting at.

To answer your quest though, I login to the Pi as the pi user and issue "sudo su -" which switches you into the root account. No need for any sudo commands from this point on. SAs don't "sudo" ;) Then I issue "/etc/init.d/girder stop" followed by "/etc/init.d/girder start".

The problem though is that during boot, USER="${USER:=root}" and HOME="${HOME:=/root}" are not being expanded (correct term?). This forces the boot time config to be read from /.config and /.local. Simply hard-coding USER=root and HOME=/root fixes the problem completely.

I'm not sure why ${USER:=root} and ${HOME:=/root} are not being read though.

Secondly, I may add that both values should probably be hard-coded anyway since only root can restart a daemon. With that said though, I have created a girder user, moved the .config and .local into /home/girder, fixed perms and hard-coded USER=girder and HOME=/home/girder. All seems well with this setup as well even though the daemon shows root as the owner of the process.

May 7th, 2015, 07:17 AM
No problem, glad to have someone who is experienced!

Looks like you figured that one out. I'll see about changing the paths in the init to fix that issue.