Closed xose closed 8 years ago
OS: CentOS 7
The work around for me was to delete the Environment="LOG_COURIER_USER=root"
line and just set User=root
Defining the user in a Env var and in the Config it's self seems like double work to me.
[Service]
Type=simple
Environment="LOG_COURIER_USER=root"
EnvironmentFile=/etc/sysconfig/log-courier
ExecStartPre=/sbin/log-courier $LOG_COURIER_ARGS -config-test
ExecStart=/sbin/log-courier $LOG_COURIER_ARGS
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
StandardError=syslog
User=$LOG_COURIER_USER
The idea was to allow the user to be changed by the environment file. Somethings not working though clearly. I need to look into it.
I can confirm I observed the same behavior on Cent OS 7 making me scratch my head to find out what could cause this. Anyway commenting line User=... helps but LC starts under root even with Environment="LOG_COURIER_USER=log-courier".
Sorry about the issue. I can confirm that User=
does not allow variables it seems.
So you have to edit User=
to contain the actual user.
I'm in process of updating the systemd units so they are config files and can be modified.
And removing LOG_COURIER_USER
variable since it cannot be used with systemd.
The reason there was the Environment=
entry as well as User=
referring to it was so there was a default, and the EnvironmentFile=
then can pull in a different user if need be.
Yes, if we edit the User=
it works as it should. If LC ever ran under root user then people don't forget to change the permissions in /var/lib/log-courier, /var/run/log-courier or it will fail to start again.
@shameerariff This isn’t the right repository for your query. I have no idea what traccar is.
@shameerariff This isn’t the right repository for your query. I have no idea what traccar is.
Sorry it was wrongly posted. Thank you.
I encounter the same problem. just update the User=
OS: Ubuntu Xenial
Starting log-courier as a systemd service fails with
status=217/USER
This is due to the default username containing a dash and being set on the service file using an environment variable.
As a workaround the user can be changed to root or any other user without a dash on the /etc/defaults/log-courier file, or set directly on the .service file with
User=log-courier