[gentoo-user] systemd service file for http-replicator

2013-12-24 Thread Adam Carter
http-replicator is a python script. My service file is as below, and if i
run the command that it generates on the command line it works.

[Unit]
Description=HTTP Replicator
After=network.target

[Service]
EnvironmentFile=/etc/conf.d/http-replicator
#Type=forking
Type=simple
PIDFile=/var/run/http-replicator.pid
ExecStart=/usr/bin/http-replicator $DAEMON_OPTS
KillSignal=SIGINT
#User=

[Install]
WantedBy=multi-user.target

# systemctl status http-replicator
http-replicator.service - HTTP Replicator
   Loaded: loaded (/usr/lib64/systemd/system/http-replicator.service;
disabled)
   Active: inactive (dead)

Dec 23 16:55:46 proxy systemd[16295]: Executing: /usr/bin/http-replicator
--daemon --dir /home/http-replicator --user portage --alias
/usr/portage/packages:packages --log /... --port 8081
Dec 23 16:55:46 proxy systemd[1]: Child 16295 belongs to
http-replicator.service
Dec 23 16:55:46 proxy systemd[1]: http-replicator.service: main process
exited, code=exited, status=0/SUCCESS
Dec 23 16:55:46 proxy systemd[1]: http-replicator.service changed running
- stop-sigterm
Dec 23 16:55:46 proxy systemd[1]: http-replicator.service: cgroup is empty
Dec 23 16:55:46 proxy systemd[1]: http-replicator.service changed
stop-sigterm - dead
Dec 23 16:55:46 proxy systemd[1]: Collecting http-replicator.service
Dec 23 16:55:49 proxy systemd[1]: Collecting http-replicator.service
Dec 23 16:57:54 proxy systemd[1]: Collecting http-replicator.service
Dec 23 16:59:52 proxy systemd[1]: Collecting http-replicator.service
Dec 24 18:53:27 proxy systemd[1]: Collecting http-replicator.service

With Type=forking, systemctl start http-replicator is slow and;
# systemctl status http-replicator
http-replicator.service - HTTP Replicator
   Loaded: loaded (/usr/lib64/systemd/system/http-replicator.service;
disabled)
   Active: failed (Result: timeout) since Tue 2013-12-24 19:27:28 EST; 10s
ago
  Process: 20430 ExecStart=/usr/bin/http-replicator $DAEMON_OPTS
(code=exited, status=0/SUCCESS)

Dec 24 19:25:58 proxy systemd[1]: Setting watch for
http-replicator.service's PID file /var/run/http-replicator.pid
Dec 24 19:25:58 proxy systemd[1]: Trying to read http-replicator.service's
PID file /var/run/http-replicator.pid in case it changed
Dec 24 19:27:28 proxy systemd[1]: http-replicator.service operation timed
out. Terminating.
Dec 24 19:27:28 proxy systemd[1]: Stopping watch for
http-replicator.service's PID file /var/run/http-replicator.pid
Dec 24 19:27:28 proxy systemd[1]: http-replicator.service changed start -
final-sigterm
Dec 24 19:27:28 proxy systemd[1]: http-replicator.service: cgroup is empty
Dec 24 19:27:28 proxy systemd[1]: http-replicator.service changed
final-sigterm - failed
Dec 24 19:27:28 proxy systemd[1]: Job http-replicator.service/start
finished, result=failed
Dec 24 19:27:28 proxy systemd[1]: Failed to start HTTP Replicator.
Dec 24 19:27:28 proxy systemd[1]: Unit http-replicator.service entered
failed state.

Any ideas on what's wrong?


Re: [gentoo-user] systemd service file for http-replicator

2013-12-24 Thread Tom Wijsman
On Tue, 24 Dec 2013 19:30:25 +1100
Adam Carter adamcart...@gmail.com wrote:

 http-replicator is a python script. My service file is as below, and
 if i run the command that it generates on the command line it works.

Can you try the one from the Portage tree?

  22 Dec 2013; Pacho Ramos pa...@gentoo.org
  +files/http-replicator.service, +files/http-replicator.service.conf,
  +http-replicator-3.0-r4.ebuild,+http-replicator-4.0_alpha2-r4.ebuild:
  Add unit file (#492502 by Joerg Neikes)

-- 
With kind regards,

Tom Wijsman (TomWij)
Gentoo Developer

E-mail address  : tom...@gentoo.org
GPG Public Key  : 6D34E57D
GPG Fingerprint : C165 AF18 AB4C 400B C3D2  ABF0 95B2 1FCD 6D34 E57D


signature.asc
Description: PGP signature