how to make an app start at boot?

Status
Not open for further replies.

pallfreeman

Dabbler
Joined
Sep 1, 2011
Messages
38
I'm using RC1. For my app "something", I'm used to doing:

something_enable="YES"

in /etc/rc.conf and putting my start/stop script into /usr/local/etc/rc.d/something.

I can "onestart" my app OK, but the boot-time settings seem volatile -- they don't survive a reboot.

I've already stumbled across /conf/base/etc/fstab and added an entry to mount my vanilla-UFS extra drive, and I'm guessing I can add my something_enable to /conf/base/etc/rc.conf, but how do I add to /usr/local/etc/rc.d?

How can I make my app start at boot, please?
 

pallfreeman

Dabbler
Joined
Sep 1, 2011
Messages
38
Yes, I can hack /conf/base/etc/rc.conf OK.

But: buggerit! My carefully crafted use of the "pw" command to add user and group for my app seems ineffective too -- /etc/passwd and /etc/group are regenerated at boot time. Is there any equivalent of "pw" which works on the SQL db? I hate SQL.

Since I don't have the option of adding 3rd-party cruft from the GUI, I'm trying to keep it simple -- just ./install.sh after ssh'ing in and unpacking the archive. I don't fancy having to explain how to create the user+group from the GUI before installing...
 

Durkatlon

Patron
Joined
Aug 19, 2011
Messages
414
There's a thread about mass-adding users to the system. The idea was to use the .dump command in SQLite to dump the entire configuration database to a text file, stick the new users in there through some batch mechanism, then re-import it. You might want to ask there how much success was had with that method.
 

pallfreeman

Dabbler
Joined
Sep 1, 2011
Messages
38
alpha 2

Thanks, I'll go look there.

I figured out how to get startup scripts to stay in /usr/local/etc/rc.d -- it's regenerated from /conf/base/etc/local/rc.d, so I write a copy in there as well.

My installer already checks for the server's user and group and doesn't try to add them if it finds them, so for the moment I can get by with documenting that they need to be added from the GUI before installing.

There has to be a simple way of doing this, though, else how does the GUI do it?

Edit: I HATE SQL. I do Solaris admin for food, and the Oracle guys freak me out even more than the suits. :)
 
Status
Not open for further replies.
Top