sequenceserver as service

Hi,

If I launch sequence server by just typing sequenceserver in the console, it works perfectly

Now, I tried to create a service script to start and stop sequenceserver under ubuntu. I took and adapt a service script example from:
http://doc.ubuntu-fr.org/tutoriel/comment_transformer_un_programme_en_service
(sorry, it’s in french but a script is a script whatever the language of the page is… ;-))

Each time I try to start the service, I get an error:

  • Starting system sequenceserver Daemon
    == Initializing SequenceServer…
    F, [2013-02-11T14:10:18.408241 #8848] FATAL – : Error in config.yml: couldn’t find HOME environment – expanding `~/.sequenceserver.conf’
    YAML is white space sensitive. Is your config.yml properly indented?

if I launch directly the service start command in a console, It works:
start-stop-daemon --background --name sequenceserver --start --exec /usr/local/bin/sequenceserver

I found a workaround by setting the .sequenceserver.conf path with the absolute path in the file /var/lib/gems/1.8/gems/sequenceserver/lib/sequenceserver.rb :
set :config_file, Proc.new{ File.expand_path(’/home/username/.sequenceserver.conf’) }
But I don’t like to modify the source code!

Do you have a idea of what the problem is?

Heya,

I am really sorry for the slow response.

Now, I tried to create a service script to start and stop sequenceserver
under ubuntu. I took and adapt a service script example from:
http://doc.ubuntu-fr.org/tutoriel/comment_transformer_un_programme_en_service
(sorry, it's in french but a script is a script whatever the language of the
page is... ;-))

Each time I try to start the service, I get an error:
* Starting system sequenceserver Daemon
== Initializing SequenceServer...
F, [2013-02-11T14:10:18.408241 #8848] FATAL -- : Error in config.yml:
couldn't find HOME environment -- expanding `~/.sequenceserver.conf'
YAML is white space sensitive. Is your config.yml properly indented?

if I launch directly the service start command in a console, It works:
start-stop-daemon --background --name sequenceserver --start --exec
/usr/local/bin/sequenceserver

I found a workaround by setting the .sequenceserver.conf path with the
absolute path in the file
/var/lib/gems/1.8/gems/sequenceserver/lib/sequenceserver.rb :
set :config_file, Proc.new{
File.expand_path('/home/username/.sequenceserver.conf') }
But I don't like to modify the source code!

Do you have a idea of what the problem is?

By default SS looks for a configuration file names
.sequenceserver.conf in the home directory of the user that launches
SS. This is done by expanding '~/.sequenceserver.conf' on startup
where '~' corresponds to home directory (/home/username on Linux and
/Users/username on Mac) of the user that launched SS. On system
startup, services are launched before any user has logged in. So the
notion of $HOME or ~ doesn't apply. So when SS is run from the shell,
it works because '~' can be meaningfully interpolated to
'/home/username'. But when launched as a service on system startup,
you have to tell SS where to read the configuration file from. You
can tell SS what configuration file to read using the `-c` command
line flag.

$ sequenceserver -c /home/username/.sequenceserver.conf

-- yeban

Hi,

I understand your point but I haven’t registered yet my service to be launched at startup (but this is the final goal indeed). This means that I am logged in and I manually try to start the service ; which ends up with the problem when expanding ~.
I finally found out that it is due to the fact that a service is launched by the root user. Consequently, the home folder was not the right one. I need to use the -c myusername options of the start-stop-daemon command to make it run correctly without going into the SS code.
Sorry, my mistake as I am not an expert in services…