Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd service fails with status=217/USER #322

Closed
xose opened this issue Jun 1, 2016 · 9 comments
Closed

Systemd service fails with status=217/USER #322

xose opened this issue Jun 1, 2016 · 9 comments
Assignees
Milestone

Comments

@xose
Copy link

xose commented Jun 1, 2016

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

@NeckBeardPrince
Copy link

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

@driskell
Copy link
Owner

driskell commented Jun 3, 2016

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.

@MKuzma
Copy link

MKuzma commented Jun 7, 2016

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".

@driskell
Copy link
Owner

driskell commented Jun 7, 2016

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.

@driskell
Copy link
Owner

driskell commented Jun 7, 2016

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.

@MKuzma
Copy link

MKuzma commented Jun 7, 2016

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.

@driskell driskell added this to the v2.0.4 milestone Jun 10, 2016
@driskell driskell self-assigned this Jun 10, 2016
driskell added a commit that referenced this issue Jul 11, 2016
Fixes #322

Fix service start failure on systems where /var/run is tmpfs
Fixes #321

Add ability to specify group as well as user
@driskell
Copy link
Owner

@shameerariff This isn’t the right repository for your query. I have no idea what traccar is.

@shameerariff
Copy link

@shameerariff This isn’t the right repository for your query. I have no idea what traccar is.

Sorry it was wrongly posted.
Thank you.

@joshuadiezmo
Copy link

I encounter the same problem. just update the User=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants