-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
how to install binary as a service in ubuntu - just getting errors #843
Comments
I ended up simplifying it greatly following this guide: https://betterprogramming.pub/unleashing-your-daemons-creating-services-on-ubuntu-731cd933e02e?gi=ff4c4fb9dc0a It works now. But I'd love to know if the service file can be installed as it appears to lock things down better. |
Your service file (following that tutorial) should work just fine! |
This worked for me, but I had to add I'm getting I used I checked my firewall logs and don't see any blocks when I try to upload. I also set the In the https://github.com/knadh/listmonk/blob/master/listmonk@.service file it has:
So I tried commenting that out and restarting
I ran If I run I searched one of the errors and found this https://bugzilla.redhat.com/show_bug.cgi?id=1975343, which says to use This says the version of systemd is just too old systemd/systemd#28492. I changed I see that @runningnoodle and @kmohrf edited the file, so I'm tagging them to see what they know. Also, I don't know if this can be fixed but it doesn't work to upload directly to |
I don’t know which versions of systemd actually provide these config options, but given that I wrote the unit 2.5 years ago I’d say: anything that is not ancient should work. Which version of systemd are you using ( Edit: Just as a ballpark guess: |
I looked up how to upgrade systemd and people say to not mess with it (eg). Seems to be mostly hard coded to CentOS 7. I'm thinking about doing a PR that:
EDIT: Nvm the + sign, commenter says it only works with the latest systemd, so I'll put |
Any reason to not include them all (files & folders) in the same location? Such as moving
Also, I'm not sure how to add a static directory to this? Would it be something like:
Would it require another
Or does there need to be something |
When I said you might want to upgrade I didn’t mean systemd itself, but the OS itself. CentOS 7 has almost served its absolutely mind-boggling 10 year lifespan. Its EOL is mid-2024. You need to find an upgrade path for that. I’m updating my Debian every 2 years and feel like a preservationist already.
Yes. Decades of convention and standardization of application packaging :). To be frank: I’ve provided the systemd unit so that it can serve as a starting point for users (like you) and people doing packaging (like me). It’s ok to take and modify it to your needs. You don’t need a template unit? That’s fine. You want to deactivate features so that the unit runs on systemd 219? That’s also fine. But I don’t think you’re doing anyone a favor if you try to upstream these changes. Most of us aren’t on systemd 219. The unit should run fine on most systems. |
Yes, I don't think any of the changes I proposed were "to deactivate features so that the unit runs on systemd 219". I ignored those errors since they didn't seem to have an impact. The changes I've proposed seem to be broad ones. I'll list them again:
|
Did you test the existing unit on a modern OS (anything from the past ~3 years) to get a feeling which errors might be caused by the old version of systemd?
|
I am not able to do that yet (I'll be moving from Centos7 to AlmaLinux next year). But given that @bamboowonder and the author of that guide both had the same issues, they seem to impact a good percentage of people who are trying to use this.
Yes, but as I noted, the + signs only work on newer versions of systemd and the depreciated command still works on all systems. Perhaps in a year or so we can switch from
I'm not familiar with the default home directory for various linux installations, but on my machine the default was It also arguably adds an unnecessary level of complexity for people who don't know what/where their EDIT: I was thinking that we could possibly have two versions of the file or even two sets of commands in the same file and comment one of them out and add more notes/comments about each set in the file. |
Hi there,
I don't have or want docker, so I'm attempting to use the binary as a service on ubuntu 20.04
I found this: https://github.com/knadh/listmonk/blob/master/listmonk@.service
and tried to adapt it to setup the binary as a service but it continues to fail.
I moved the config to /etc/listmonk and the binary to /usr/bin
after enabled, daemon-reload, start are run, I get this in the log:
`
sudo systemctl status listmonk.service
● listmonk.service - listmonk mailing list and newsletter manager ()
Loaded: loaded (/etc/systemd/system/listmonk.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2022-06-19 15:06:53 PDT; 4min 44s ago
Condition: start condition failed at Sun 2022-06-19 15:11:35 PDT; 2s ago
└─ ConditionPathExists=/etc/listmonk/.toml was not met
Jun 19 15:06:53 send systemd[1]: listmonk.service: Control process exited, code=exited, status=203/EXEC
Jun 19 15:06:53 send systemd[1]: listmonk.service: Failed with result 'exit-code'.
Jun 19 15:06:53 send systemd[1]: Failed to start listmonk mailing list and newsletter manager ().
Jun 19 15:06:53 send systemd[1]: listmonk.service: Scheduled restart job, restart counter is at 5.
Jun 19 15:06:53 send systemd[1]: Stopped listmonk mailing list and newsletter manager ().
Jun 19 15:06:53 send systemd[1]: listmonk.service: Start request repeated too quickly.
Jun 19 15:06:53 send systemd[1]: listmonk.service: Failed with result 'exit-code'.
Jun 19 15:06:53 send systemd[1]: Failed to start listmonk mailing list and newsletter manager ().
Jun 19 15:11:32 send systemd[1]: /etc/systemd/system/listmonk.service:48: Invalid device node path 'False', ignoring.
Jun 19 15:11:35 send systemd[1]: Condition check resulted in listmonk mailing list and newsletter manager () being skipped.
`
It seems like it is expecting variables to be passed in
ConditionPathExists=/etc/listmonk/.toml
which should be config.toml but in the file is %i.toml
Any insight about the correct way to install as a service would be appreciated.
Thank you,
The text was updated successfully, but these errors were encountered: