How to start a script at startup/shutdown?

Status
Not open for further replies.

lyzanxia

Dabbler
Joined
Jul 16, 2011
Messages
15
Just starting with freenas 8 and am puzzled how to get sabnzbd started at startup.
Have a script ready, but where can I hook it up?
Rc.d seems to be overwritten by freenas on startup, and the cron @reboot option seems to be missing?

ps: I read that on 7.2 you have some sort of postinit option in the gui..

Any help would be welcome :)

Thanks
Nico
 

alexsimps

Cadet
Joined
Oct 30, 2011
Messages
1
Ya where is the so called System > Advanced > Command script ?

In freenas 7 there was System > Advanced > Command script then select "postinit" but ya i am using freenas 8 now and cannot find a way to add a startup script either? Hopefully i can figure something out.... so ya bump:confused:
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I doesn't exist in FreeNAS 8, there's a ticket requesting it as a feature already. Here's a link if you want to add a +1
https://support.freenas.org/ticket/572

You can create /conf/base/etc/rc.local and add commands like below that will start when the system boots:

Code:
#/bin/sh
/usr/bin/uptime > /var/log/uptime.log


You'll need to do it from the console / command line.
First 'mount -uw /'
Then you can use vi, ee, or nano to edit/create rc.local
 

arryo

Dabbler
Joined
May 5, 2012
Messages
42
I have question about the rc.local file, I can name it anything right, like rc.job1 in /conf/base/etc/? and do i need to set mod executable for it?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I could be mistaken, but I think the system looks specifically for a file called "rc.local", but yes, you should make it executable also.
 

arryo

Dabbler
Joined
May 5, 2012
Messages
42
I could be mistaken, but I think the system looks specifically for a file called "rc.local", but yes, you should make it executable also.

Thank you for your quick answer, so if I want two scripts in start up so I should add all commands to the "rc.local"?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Yes. Use "rc.local" for your custom startup commands. According to the man page it's the older, not to mention simpler, method, but it's still fully supported.
 

laster13

Cadet
Joined
Apr 19, 2013
Messages
9
hello
I would like to start automatic subsonic when freenas 8.3.1 start
how can I do
excuse for my english... Im french
thanks!
 
Status
Not open for further replies.
Top