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 does't work for 'package' install_method #584

Open
wilful opened this issue Oct 4, 2021 · 6 comments
Open

Systemd service does't work for 'package' install_method #584

wilful opened this issue Oct 4, 2021 · 6 comments

Comments

@wilful
Copy link

wilful commented Oct 4, 2021

Hello! If i choose 'packege' install_methon. After installation i have broken systemd service on my server, like this (binary file placed in /usr/bin from official Hashicorp repository mirror):

# systemctl cat consul
# /etc/systemd/system/consul.service
# THIS FILE IS MANAGED BY PUPPET
[Unit]
Description=Consul Agent
After=network-online.target
Wants=network-online.target

[Service]
Type=exec
User=consul
Group=consul
ExecStart=/usr/local/bin/consul agent \
  -config-dir /etc/consul
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
LimitNOFILE=131072

[Install]
WantedBy=multi-user.target

Because default setting bin_dir work only for 'url' install_method, after changing this need to configure bin_dir too
May be need set to default bin folder, when i choose 'package'?

@wilful
Copy link
Author

wilful commented Oct 4, 2021

Or need disable overriding service file by puppet if i use package method, i don't know how set it

@solarkennedy
Copy link
Contributor

@wilful
Copy link
Author

wilful commented Oct 4, 2021

By default Service overdid version from repository, and set to local/bin. If i set instal_method from package i expect what service file will be from rpm package or some

@rhandimartin
Copy link

Is this possibly related to the version of systemd being used? i know they have gone from camptocamp-systemd to puppet-systemd, and i have been tracking fora discussing unexpected behavior on the 3.x branch of the new module

@FcoCalero
Copy link

FcoCalero commented Dec 5, 2021

Hi,

I made that work commenting from the /etc/systemd/system/consul.service file the following lines:

User=consul
Group=consul

If you run the process manually with root, it works, however if you tries the server unit, it doesn't work because it launches the service under consul user which apparently doesn't have permissions to do it, maybe adding a line to sudo file might solve the problem, i ignore if it is like that with other install method.

Hope this helps.

Regards

@FcoCalero
Copy link

Hi,

I made that work commenting from the /etc/systemd/system/consul.service file the following lines:

User=consul Group=consul

If you run the process manually with root, it works, however if you tries the server unit, it doesn't work because it launches the service under consul user which apparently doesn't have permissions to do it, maybe adding a line to sudo file might solve the problem, i ignore if it is like that with other install method.

Hope this helps.

Regards

***Update

The folder/files where the app is installed is not owned by consul user, i have done a chown to consul user and it works.

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

No branches or pull requests

4 participants