Groupname left blank #5

Closed
opened 5 years ago by ryanburnette · 1 comments

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 5 years ago
coolaj86 closed this issue 5 years ago
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

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.