You are not logged in.
Pages: 1
Hello,
I'm creating a package for a key value data store and I'm trying to install the systemd service too.
I have something like this:
[Unit]
Description=Kyoto Tycoon key-value server (and Kyoto Cabinet library)
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/run/kyoto.pid
PrivateDevices=yes
SyslogLevel=err
Restart=on-abort
User=kyoto
Group=kyoto
EnvironmentFile=/etc/conf.d/kyoto
ExecStartPre=/bin/rm -f '/run/kyoto.pid'; chown kyoto.kyoto /var/log/kyoto.log
ExecStart=/usr/bin/ktserver -dmn -pid /run/kyoto.pid -log /var/log/kyoto.log $KTSERVER_OPTS
ExecReload=/usr/bin/kill -HUP /run/kyoto.pid
KillSignal=SIGQUIT
KillMode=mixed
[Install]
WantedBy=multi-user.target
The service starts and stops but, when I do:
# systemctl start kyoto.service, it starts and hangs in the terminal. I have to Ctrl-C for exit, but the service keeps running normally until I do a stop.
How can I avoid to have the service waiting in the terminal? Maybe I'm doing something wrong.
Thanks,
Dani
Last edited by danifbento (2015-02-15 13:24:48)
Offline
Please use code tagswhen posting code or file contents as it makes it more readable.
The semicolon in the ExecStartPre line must be separated from the first command by a space:
Multiple command lines may be concatenated in a single directive by separating them with semicolons (these semicolons must be passed as separate words).
Also, are you sure kyoto forks itself? If you just run ktserver from the command line, are you immediately returned to a prompt, or does it take time to start up?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Maybe you are missing permission to create the pidfile, so systemd never sees that the service is ready.
Edit: By the way, you don't have to do work with the logfile. You could use the default output to stdout and let systemd send it all to journald.
Last edited by progandy (2015-02-15 02:57:08)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Hello,
Thanks for the answers (I updated the post to more readable with de code tag)
The problem was in the PID file. I have configured to create it at /run/kyoto.pid, but the service is running with kyoto user permissions.
I put in the kyoto.conf (for the tempfiles.d) the line:
D /run/kyoto 0755 kyoto kyoto -
And change the PID file to /run/kyoto/kyoto.pid an now it's running well! Thanks a lot!
I also removed the log file, how can I see the specific kyoto service lines in the journald? Is it need to configure anymore thing in the service?
Thanks a lot!
Offline
Pages: 1