Topic: Format of /psp/start_xxx command?

In the wiki, there is a mention of creating /psp/start_sshd to automatically run sshd. Are there any more details on that.

For a (somewhat contrived) example, I want to run syslogd with a config file parameter. Can I do that by creating /psp/start_syslogd with command flag inside the file? Any other way?

If it is a standard Linux functionality, an RTFM with topic name is an acceptable answer.

2 (edited by dwatson 2007-10-31 16:01:05)

Re: Format of /psp/start_xxx command?

WARNING: This script gets ran early in the rcS script and then EXITS that script. It doesn't even start the network before it exits out. If you do not copy the rest of /etc/init.d/rcS from the point it starts /psp/rfs1/rcS into the end of the /psp/rfs1/rcS script, it will NOT boot all the way. I just tested this, and didn't pay attention to that exit in /etc/init.d/rcS. My chumby is down for the moment. sad I'm hoping there is a way to get rid of that file out of /psp/rfs1, or my Chumby won't be coming back up.

Looking at the rcS startup script in /etc/init.d/rcS, it looks like if you have a script in /psp/rfs1/rcS then it will execute that script at startup.

You could make /psp/rfs1/rcS this:

#!/bin/sh

/sbin/syslogd

Make sure you chmod 755 on it. Also note that it doesn't look like the syslogd that comes with the chumby supports config files.

Re: Format of /psp/start_xxx command?

Thank you for the warning. I missed that exit as well. And while busybox's syslogd does not take a config file option, I actually wanted it to point at the target log file. That option does exist.

As to getting your chamby to work again, I assume /psp is a memory mapped storage. So, removing all power supplies hopefully will fix it. Otherwise, let's hope there is an hardwired reboot in there somewhere. I really do.

Re: Format of /psp/start_xxx command?

Just to compete this topic, start_sshd is a special case flag that is checked in /usr/chumby/scripts/start_network script and it just starts /sbin/sshd (no flags).

So, there is no easy way to add other services. It will have to be done via rcS script hack or maybe via adding an entry to crontabs (/psp/crontabs/root)

5 (edited by dwatson 2007-11-01 06:29:36)

Re: Format of /psp/start_xxx command?

I chatted with Duane last night and he set me straight on how to fix it. If anyone gets into that situation, you can still run the "debugchumby" script from a USB dongle and have it remove /psp/rfs1/rcS. /psp is persistent, so powering it down will not get rid of it. So, in my case, what I did was made a simple script in the root directory of my USB device:

#!/bin/sh

rm /psp/rfs1/rcS

and did a chmod 777 on it, put the USB device into the Chumby, and rebooted. Viola. Fixed! smile

Re: Format of /psp/start_xxx command?

I am rather curious why it worked. The debugchumby script call is significantly later in the /etc/init.d/rcS script than /psp/rfs1/rcS.

So if bad /psp script really did stop further execution, usb should have never even mounted. I would have tested this myself, but really not sure it is worth the risk to discover I am right.

Re: Format of /psp/start_xxx command?

He did this debugchumby file when booting into the "Special Options" mode (rfs2), and therefore doesn't run the /psp/rfs1/rcS file.

8 (edited by dwatson 2007-11-03 22:10:23)

Re: Format of /psp/start_xxx command?

Ahh, yes. Sorry I wasn't clear on that part. You do have to boot into special options mode first.

But to arafalov: I had also noticed that it loads debugchumby from /etc/init.d/rcS way further into the script after the exit, so I was worried that I had just bricked it. Luckily, Duane came through with the idea to boot into special options and then it runs debugchumby directly off the USB device before it even begins starting up rcS. smile

Re: Format of /psp/start_xxx command?

So, what is the special options mode? I tried holding screen during boot, but got nothing. I think I saw 'update/restore' mode once before, but could not reproduce it.

Re: Format of /psp/start_xxx command?

arafalov wrote:

So, what is the special options mode? I tried holding screen during boot, but got nothing. I think I saw 'update/restore' mode once before, but could not reproduce it.

That's how you do it. You have to have it turned off, then hold your finger on the screen while turning it on. Eventually it should come up with "special options" and then you can remove your finger from the screen.