Groupname left blank #5

Closed
opened 2019-07-16 15:14:40 +00:00 by ryanburnette · 1 comment

I created a service and the group was left blank.

ryan@worker:/opt/myservice$ sudo serviceman add --name myservice --username ryan --dryrun ./myservice
OPTIONS: Making some assumptions...

        # Because you're a privileged user
          --system

        # Because this is your current working directory
          --workdir /opt/myservice

COMMAND: Service "myservice" will be run like this (more or less):

        # Starts on system boot, as "ryan"
        /opt/myservice/myservice

# Pre-req
# sudo mkdir -p /opt/myservice/ /var/log/myservice
# sudo adduser ryan --home /opt/myservice
# sudo chown -R ryan: /opt/myservice/ /var/log/myservice
# sudo systemctl restart myservice.service
# sudo journalctl -xefu myservice

[Unit]
Description=myservice
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
# Restart on crash (bad signal), but not on 'clean' failure (error exit code)
# Allow up to 3 restarts within 10 seconds
# (it's unlikely that a user or properly-running script will do this)
Restart=always
StartLimitInterval=10
StartLimitBurst=3

# User and group the process will run as
User=ryan
Group=

WorkingDirectory=/opt/myservice
ExecStart=/opt/myservice/myservice
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target

ryan@worker:/opt/myservice$
I created a service and the group was left blank. ``` ryan@worker:/opt/myservice$ sudo serviceman add --name myservice --username ryan --dryrun ./myservice OPTIONS: Making some assumptions... # Because you're a privileged user --system # Because this is your current working directory --workdir /opt/myservice COMMAND: Service "myservice" will be run like this (more or less): # Starts on system boot, as "ryan" /opt/myservice/myservice # Pre-req # sudo mkdir -p /opt/myservice/ /var/log/myservice # sudo adduser ryan --home /opt/myservice # sudo chown -R ryan: /opt/myservice/ /var/log/myservice # sudo systemctl restart myservice.service # sudo journalctl -xefu myservice [Unit] Description=myservice After=network-online.target Wants=network-online.target systemd-networkd-wait-online.service [Service] # Restart on crash (bad signal), but not on 'clean' failure (error exit code) # Allow up to 3 restarts within 10 seconds # (it's unlikely that a user or properly-running script will do this) Restart=always StartLimitInterval=10 StartLimitBurst=3 # User and group the process will run as User=ryan Group= WorkingDirectory=/opt/myservice ExecStart=/opt/myservice/myservice ExecReload=/bin/kill -USR1 $MAINPID [Install] WantedBy=multi-user.target ryan@worker:/opt/myservice$ ```
ryanburnette changed title from Groupname is blank in config to Groupname left blank 2019-07-16 15:20:25 +00:00
Owner

I believe I fixed this with c78cd82059

I think it was only an issue on MacOS and in the Dry-Run on Linux.

I believe I fixed this with https://git.coolaj86.com/coolaj86/go-serviceman/commit/c78cd82059052d1502c2069ea18b6aa2f4f86da3 I think it was only an issue on MacOS and in the Dry-Run on Linux.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coolaj86/go-serviceman#5
No description provided.