Installed services in jail via commandline... reboot they are gone

Status
Not open for further replies.

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
Why are certain changes I make to my jail no longer available after I reboot the jail?

I installed node.js in one of my jails. It was all working perfectly, until I restarted the jail. I can still see all of the proper files, but it's as though the jail wiped the config.

Frustrating.

Why does it do this, and how can I prevent this from happening??

thanks!
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
What config was wiped? The rc scripts?
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
I suppose so... I added a path to execute node.js b/c I installed it using a git repository. The path did not stick after reboot. And strangely enough, when I readded the path, it still didn't execute properly. How it was working fine one moment, the jail reboots and everything is completely broken is beyond me.
I assume the path being wiped is a result of the rc script, but not so sure how even by readding the path, node still wouldn't execute without me fulling reinstalling it.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Where did you add the path?
How did you start the node.js process?

If you installed from git, I'm not sure that an rc file would have been installed. Did you actually run something like "make install"? Or did you just run "make"?

Do you need to install grom git? node is available in the ports tree and would, I think, install the rc file for you.

Is there anything at any of the following paths?
/usr/local/etc/rc.d/node
/usr/etc/rc.d/node
/etc/rc.d/node
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
Where did you add the path?
How did you start the node.js process?

If you installed from git, I'm not sure that an rc file would have been installed. Did you actually run something like "make install"? Or did you just run "make"?

Do you need to install grom git? node is available in the ports tree and would, I think, install the rc file for you.

Is there anything at any of the following paths?
/usr/local/etc/rc.d/node
/usr/etc/rc.d/node
/etc/rc.d/node


No node in any of those paths.

I start node by typing "node server.js". Node must be executable from anywhere, which is why I need to set the path.

The whole reason I install from git is because the purpose I need it for requires a very specific version of node - v0.8. It is much easier to install node via pkg_add, but then I get v0.10 which breaks my web server (I'm running Parsoid for a mediawiki install I did, Parsoid is a pain in the ass and very particular about it's requirements).

I use "git clone" currently to get what I need, then I have to build the branch using "git checkout", then run "/.configure && gmake", then set a path using "set path=(/usr/local/www/mediawiki/www/extensions/Parsoid/js/node $path)".
Pain in the ass to have to do this every time I reboot the server.
Is grom git some enhance version of git that would automate the whole process I listed above, and do a proper install? If so, sign me up. Could I just do "pkg_add -r grom git" or something like that, and then if I use it to grab a git it will do the rest for me?
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
Also, didn't have this problem on 8.2. This new jail system in 9.1 is great, but I suppose I have to learn the nuances.
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
Even better, how could I get node to start as a service when my jail boots up, so I don't have to manually execute it every time I restart?
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Will have to check the actual rc variable, but my guess is:
Code:
node_enable="YES"

Add that to the jail's /etc/rc.conf file.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
"grom git" is a wonderful system known as a typo ;-)

OK, so it sounds like you should also be able to start the service by running:
Code:
/usr/local/www/mediawiki/www/extensions/Parsoid/js/node/node /usr/local/www/mediawiki/www/extensions/Parsoid/js/node/server.js

Or at least something similar if those full paths are wrong.

I think overall your problems can be solved by your most recent post regarding automatically starting the service with the jail.

You want to create an rc script; here's a decent tutorial on that: http://lostandunfound.hubpages.com/hub/FreeBSD-Own-bootup-script

You can set the path or just use absolute paths in the script. The service will then start with the jail and you can stop and restart it without having to worry about manually setting the path.
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
thanks! that sounds easy enough. As long as my path doesn't get wiped on reboot that should hopefully work.

i am genuinely curious about grom git still... wonder if it simplifies the git building process.
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
lol! that's too bad about grom git.

Thanks for the help guys, good learning here.
 
Status
Not open for further replies.
Top