0
Answered
Start at boot on Ubuntu? Deamonize?
I love what I am seeing here. I can run it with no problems from the command line with scripts provided. I have tried following linux documentation to get it to run headless at boot time (copied to the /etc/init.d, owned by root, etc), but I am having no luck. Any thoughts or links that may help?
Thanks in advance!
Thanks in advance!
Customer support service by UserEcho
http://zerocool.is-a-geek.net/running-java-program-as-a-daemon-in-ubuntu-linux/
I will give it a shot and report with what I find.
Thanks again!
Jim
I've been playing around with the scripts and have found that even when declaring the fully qualified path to the install directory containing the Ubooqity.jar file, it appears to ignore it and creates the logs, cache, theme directories and the rest of the files in the path from which the script is being called.
This becomes a problem in having a script call the Ubooquity.jar command from the /etc/init.d directory where the startup scripts are located. It recreates a new instance of the Ubooquity files within the /etc/init.d directory which will cause problems shutting down and starting up the system (not to mention propagating the application into a path where it does not belong).
I'm not sure if it is by design that the jar file will populate its required files structure to the path from which the script is run (it does make for a quick and easy install) or if there is some other parameter to pass along to it within the script to point to an absolute path where the expected files are to (and may already) reside.
Thanks for your help!
Jim
Looking further into the comments section of the link you provided, it appears adding a line at the beginning to change to my program directory solved the issue with propagating the files into the /etc/init.d:
Apparently the author's java file contained a line:
to enable the setting of the working directory upon its launch.
Looking good so far! Thanks for the help!
The solution is indeed to go into the directory you want to use before calling the "java" command.
If you really want to be ablre to specify your "working directory" (although I can"t think of a scenario where you could not simply go into the directory to launch Ubooquity), you can do it by explicitely setting the Java "user.dir" property:
But I don't really recommend that solution as it could have unintended side effects (I don't know any but it's safer to just use your method).
I'm glad it's working now. Don't hesitate to let me know if you have other questions.
http://isotope11.com/blog/manage-your-services-wit...
Here are the two scripts I use to set up my service:
The ubooquity/run script is set up to always run from /opt/ubooquity to keep the database in one place and also combines STDERR with STDOUT for logging. The ubooquity/log/run script rotates the log after 10MB and retains 5 previous.
I've put ubooquity in /opt/Ubooquity and I'm able to run it from the command line, i just don't understand how to make it run at start up.
Also i found a script that said put this in ubooquity.conf in /etc/init and run it, but it gave me a bunch of errors.
start on runlevel [3]
stop on shutdown
expect fork
script
cd /opt/Ubooquity
java -jar Ubooquity.jar -webadmin -port 9093 -headless
emit ubooquity_running
end script
I am on Ubuntu Server 14.10. Here are my notes if they may be any help to you (or anyone else for that matter). It may not be the most elegant solution, but it is solid enough for me.
Cheers,
Jim
Hi Jim,
I just found your script to deamon-ise ubooquity, it works like a charm, with one caveat.
Im wanting to add the extra mem, but when i uncomment the line #MEM_OPTS. the service refuses to start giving an error:
'Command line arguments error: joptsimple.UnrecognizedOptionException: X is not a recognized option'
Any ideas?
Thanks again for providing the script.
Porph!
Update, i had a look at a couple of other scripts and the $MEM_OPTS was placed just after java and before the -jar...if that makes sense, so all sorted
cheers for the script!!
That's because the memory option is intended for the Java Virtual Machine, not the Ubooquity program itself (which is running inside the JVM).
thanks man, that seems to have done the trick!
Thanks a lot for sharing your notes!!
I lost the HDD of my debian and had to all re-install from scratch.
Your script prevented me to rewrite it.
I just had to change the directory and it worked like a charm :-)
@Tom: it should be aded to the help page (except if I missed it, it is not)
Cheers,
Mat
I'll add an entry in the FAQ.
By the way, there was a typo in my script (which is also in Jim's script):
should be
(remove the $)
Mind you, this is is via ssh from my laptop. You can probably ignore the -headless option if you don't need it. I use it because my server is headless.
hello guys, I am super new to linux, just playing around with it, and I manage to set Ubooquity and all, but I did noticed that when I restart my server machine, it doest boot up, I need to open manualy Ubooquity.jar any help? thanks! (Do I use the scrip thats in the download page?)
Hello,
The script on the download page is just a manual start/stop script for command line usage, it won't start Ubooquity automatically with your system.
Do do that you'll need to either run it as a daemon, or use a cron job.
Both solution are described in this thread above. :)
Here's the upstart script I use on Ubuntu:
#Ubooquity startup script