A few improvements to the systemd unit #1064

Merged
nex merged 2 commits from ginger/systemd-improvements into main 2025-10-17 15:04:51 +00:00
Member

These should allow packaging for Arch, but are generally applicable to all distros.

thoughts:

  • systemd credentials have a hard size limit of 1 megabyte. it seems unlikely that this will ever become a problem, but who knows
  • it might be desirable to add support for reading and merging multiple config files, both as a solution to ^ and as a way to set distro-specific config in a file instead of using env vars in the unit
These should allow packaging for Arch, but are generally applicable to all distros. thoughts: - systemd credentials have a hard size limit of 1 megabyte. it seems unlikely that this will ever become a problem, but who knows - it might be desirable to add support for reading and merging multiple config files, both as a solution to ^ and as a way to set distro-specific config in a file instead of using env vars in the unit
feat: Make a few improvements to the systemd unit
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 39s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m3s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 4m16s
37d848b4ef
- Use systemd's credential system to supply our config file
- Remove `ConfigurationDirectory` to prevent conflicts with package managers
- Set `config_reload_signal` to true using an envvar
Owner

We should be able to add multiple layers of config files, we're already doing that for env and command line args for example. We're using figment, it's just a matter of adding new bits here. Side node, I think we technically already do have that, just with continuwuity_config overides conduwuit_config and so on lmao.

We should be able to add multiple layers of config files, we're already doing that for env and command line args for example. We're using [figment](https://docs.rs/figment/latest/figment/), it's just a matter of [adding new bits here](https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/src/core/config/mod.rs#L2212). Side node, I think we technically already do have that, just with continuwuity_config overides conduwuit_config and so on lmao.
Author
Member

@Jade wrote in #1064 (comment):

We should be able to add multiple layers of config files, we're already doing that for env and command line args for example. We're using figment, it's just a matter of adding new bits here. Side node, I think we technically already do have that, just with continuwuity_config overides conduwuit_config and so on lmao.

I noticed that while working on this, actually 💀 the question is if that's worth including in this PR or if we can stick with using systemd's Environment setting

@Jade wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1064#issuecomment-20475: > We should be able to add multiple layers of config files, we're already doing that for env and command line args for example. We're using [figment](https://docs.rs/figment/latest/figment/), it's just a matter of [adding new bits here](https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/src/core/config/mod.rs#L2212). Side node, I think we technically already do have that, just with continuwuity_config overides conduwuit_config and so on lmao. I noticed that while working on this, actually 💀 the question is if that's worth including in this PR or if we can stick with using systemd's `Environment` setting
Owner

I mean honestly up to you, oh packaging wizard :P. I don't really know half of what I'm looking at here

I mean honestly up to you, oh packaging wizard :P. I don't really know half of what I'm looking at here
Member

If we do use EnvironmentFile, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations.

If we do use `EnvironmentFile`, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations.
Author
Member

@Kimiblock wrote in #1064 (comment):

If we do use EnvironmentFile, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations.

(typo, I meant Environment not EnvironmentFile)

@Kimiblock wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1064#issuecomment-20512: > If we do use `EnvironmentFile`, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations. (typo, I meant `Environment` not `EnvironmentFile`)
ginger force-pushed ginger/systemd-improvements from 37d848b4ef
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 39s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m3s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 4m16s
to 29f138ed0f
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 44s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m16s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 4m51s
2025-09-24 12:33:33 +00:00
Compare
ginger changed title from WIP: A few improvements to the systemd unit to A few improvements to the systemd unit 2025-09-24 12:33:36 +00:00
nex added this to the 0.5.0 milestone 2025-09-25 02:11:52 +00:00
ginger force-pushed ginger/systemd-improvements from 29f138ed0f
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 44s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m16s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 4m51s
to e2f431d426
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 52s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m37s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4m49s
2025-09-25 12:52:39 +00:00
Compare
Member

@ginger wrote in #1064 (comment):

@Kimiblock wrote in #1064 (comment):

If we do use EnvironmentFile, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations.

(typo, I meant Environment not EnvironmentFile)

Ummm, you mean writing configurations directly in a systemd override service?

@ginger wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1064#issuecomment-20582: > @Kimiblock wrote in #1064 (comment): > > > If we do use `EnvironmentFile`, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations. > > (typo, I meant `Environment` not `EnvironmentFile`) Ummm, you mean writing configurations directly in a systemd override service?
Kimiblock approved these changes 2025-09-26 06:53:59 +00:00
Author
Member

@Kimiblock wrote in #1064 (comment):

@ginger wrote in #1064 (comment):

@Kimiblock wrote in #1064 (comment):

If we do use EnvironmentFile, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations.

(typo, I meant Environment not EnvironmentFile)

Ummm, you mean writing configurations directly in a systemd override service?

User configuration will still be written in conduwuit.toml with this PR. I was thinking about ways to put vendor configuration in another configuration file instead of in the unit file, but I don't think that's necessary right now since the unit only changes a few options.

@Kimiblock wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1064#issuecomment-20673: > @ginger wrote in #1064 (comment): > > > @Kimiblock wrote in #1064 (comment): > > > If we do use `EnvironmentFile`, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations. > > > > > > (typo, I meant `Environment` not `EnvironmentFile`) > > Ummm, you mean writing configurations directly in a systemd override service? User configuration will still be written in `conduwuit.toml` with this PR. I was thinking about ways to put vendor configuration in another configuration file instead of in the unit file, but I don't think that's necessary right now since the unit only changes a few options.
ginger force-pushed ginger/systemd-improvements from e2f431d426
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 52s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m37s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4m49s
to 9a0116df61
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 45s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m26s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4m20s
2025-09-26 13:00:57 +00:00
Compare
Member

@ginger wrote in #1064 (comment):

@Kimiblock wrote in #1064 (comment):

@ginger wrote in #1064 (comment):

@Kimiblock wrote in #1064 (comment):

If we do use EnvironmentFile, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations.

(typo, I meant Environment not EnvironmentFile)

Ummm, you mean writing configurations directly in a systemd override service?

User configuration will still be written in conduwuit.toml with this PR. I was thinking about ways to put vendor configuration in another configuration file instead of in the unit file, but I don't think that's necessary right now since the unit only changes a few options.

Ah yes, that's kinda annoying. I have 2 options on my mind rn:

a) support multiple configurations and stack them together

b) set EnvironmentFile in a service override file, and users can disable it via another override

@ginger wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1064#issuecomment-20681: > @Kimiblock wrote in #1064 (comment): > > > @ginger wrote in #1064 (comment): > > > @Kimiblock wrote in #1064 (comment): > > > > If we do use `EnvironmentFile`, the docs should be modified to reflect that. Also on some package managers you have to manually specify it as "reserved" (i.e. uninstalling will not remove the file). Same as "stacked" configurations. > > > > > > > > > (typo, I meant `Environment` not `EnvironmentFile`) > > > > > > Ummm, you mean writing configurations directly in a systemd override service? > > User configuration will still be written in `conduwuit.toml` with this PR. I was thinking about ways to put vendor configuration in another configuration file instead of in the unit file, but I don't think that's necessary right now since the unit only changes a few options. Ah yes, that's kinda annoying. I have 2 options on my mind rn: a) support multiple configurations and stack them together b) set `EnvironmentFile` in a service override file, and users can disable it via another override
ginger force-pushed ginger/systemd-improvements from 9a0116df61
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Successful in 45s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m26s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 4m20s
to 314250a0a1
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 59s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 5m37s
2025-09-29 15:47:51 +00:00
Compare
ginger force-pushed ginger/systemd-improvements from 314250a0a1
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 59s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 5m37s
to 4bdc2557d6
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 43s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m29s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 6m29s
2025-10-03 12:51:23 +00:00
Compare
Owner

Is this good for merge?

Is this good for merge?
Author
Member

@nex wrote in #1064 (comment):

Is this good for merge?

Yes, this is good to merge.

@nex wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1064#issuecomment-21052: > Is this good for merge? Yes, this is good to merge.
ginger force-pushed ginger/systemd-improvements from 4bdc2557d6
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 43s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m29s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 6m29s
to 4a795a509c
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m8s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m7s
2025-10-16 12:59:14 +00:00
Compare
ginger force-pushed ginger/systemd-improvements from 4a795a509c
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m8s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m7s
to a3592bd3b7
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Successful in 47s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m43s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m10s
Documentation / Build and Deploy Documentation (push) Successful in 54s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m40s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 8m52s
2025-10-17 13:37:44 +00:00
Compare
nex merged commit a3592bd3b7 into main 2025-10-17 15:04:51 +00:00
nex deleted branch ginger/systemd-improvements 2025-10-17 15:04:51 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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
continuwuation/continuwuity!1064
No description provided.