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

fix config file name in service configuration #1220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dsl400
Copy link

@dsl400 dsl400 commented May 21, 2024

The config path is etc/openfortivpn/config
The service does not start because it tries to load etc/openfortivpn/config.conf

@DimitriPapadopoulos
Copy link
Collaborator

Please provide background information in the commit message. Why should the confg file be %I instead of %I.conf?

@DimitriPapadopoulos
Copy link
Collaborator

@dsl400 Why do you want to remove the .conf file extension?

@dsl400
Copy link
Author

dsl400 commented Jun 2, 2024

@DimitriPapadopoulos The config is stored at etc/openfortivpn/config
I need to run openfortivpn as service and it does not start because it tries to load etc/openfortivpn/config.config

The fastest option was to remove .conf

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Jun 2, 2024

The file name is generated from /etc/openfortivpn/%I.conf, but I don't see why the value of %I would be config in your case. For instantiated units, %i is the string between the first @ character and the type suffix.

See systemd.unit(5).

I mean, I appreciate that it fixed your use case, but we cannot accept a fast tweak that happens to fix a single use case. You need to explain what your fix does and why it is the right thing.

@dsl400
Copy link
Author

dsl400 commented Jun 2, 2024

Sorry. It tries to load config.conf

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Jun 2, 2024

And? Ask yourself why first?

@dsl400
Copy link
Author

dsl400 commented Jun 3, 2024

And? Ask yourself why first?

yep .... It is what it is .... a strange world out there.

You could just spare us the pain and uncover the secret or dismiss the PR and move on with your life leaving us to live in the eternal pain caused by not knowing this

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Jun 3, 2024

I cannot recall myself. I only know this pull request cannot be merged without any form of explanation: it breaks existing behaviour for the sake of an obscure use case without any explanation. I hoped you could look into this question since you opened an issue.

@dsl400
Copy link
Author

dsl400 commented Jun 3, 2024

root@desktop:/home/dsl400# systemctl start [email protected] Job for [email protected] failed because the control process exited with error code. See "systemctl status [email protected]" and "journalctl -xeu [email protected]" for details.

root@desktop:/home/dsl400# systemctl status [email protected] × [email protected] - OpenFortiVPN for config Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2024-06-03 13:00:08 EEST; 2s ago Docs: man:openfortivpn(1) https://github.com/adrienverge/openfortivpn#readme https://github.com/adrienverge/openfortivpn/wiki Process: 6356 ExecStart=/usr/local/bin/openfortivpn -c /usr/local/etc/openfortivpn/config.conf (code=e> Main PID: 6356 (code=exited, status=254) CPU: 4ms

Jun 03 13:00:08 desktop systemd[1]: [email protected]: Main process exited, code=exited, status=> Jun 03 13:00:08 desktop systemd[1]: [email protected]: Failed with result 'exit-code'. Jun 03 13:00:08 desktop systemd[1]: Failed to start OpenFortiVPN for config. Jun 03 13:00:08 desktop systemd[1]: [email protected]: Scheduled restart job, restart counter is> Jun 03 13:00:08 desktop systemd[1]: Stopped OpenFortiVPN for config. Jun 03 13:00:08 desktop systemd[1]: [email protected]: Start request repeated too quickly. Jun 03 13:00:08 desktop systemd[1]: [email protected]: Failed with result 'exit-code'. Jun 03 13:00:08 desktop systemd[1]: Failed to start OpenFortiVPN for config.
`

because the service does not start

@mrbaseman
Copy link
Collaborator

Maybe the point is an inconsistency between the naming convention in the provided systemd service template file where the suffix .conf is used and the default config mentioned in the man page or in the help message.

Usually, the expectation is, that the default config file is adapted for different vpn connections, and of course, if a service shall be run, the appropriate configuration file for that particular service should be supplied. This is done by a systemd service template, where the parameter %I is replaced by the instance of this service, in order to pick up the correct config file.

At both places, manual action is required: The sample config needs to be copied to one or more specific config files, and filled in with specific connection parameters. The systemd service template needs to be linked to the appropriate service name. Both names should match. Now, the traditional sample config file name for openfortivpn has always been config, whereas systemd would expect config files to be named with the suffix .conf - however, this is not a must. We could either remove the .comfsuffix in the service template, or we continue to expect users copying the sample config file to something like mycorp.conf. Or, 3rd option, append .conf to the sample config file name, but I guess package maintainers might not be amused about that move.

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

Successfully merging this pull request may close these issues.

None yet

3 participants