Set environment variables (Environment=, EnvironmentFile=)
Change restart policy, timeouts, resource limits
Add ExecStartPre / ExecStartPost hooks
Proposed config
template:/etc/unitdore/unit.service.tmpl # optional path to custom template
Template uses Go text/template with the same templateData struct already in systemd/generator.go. Built-in template is used as fallback if no custom template is set.
Per-unit override
Also consider allowing per-unit template overrides:
Allow users to provide their own `.service` file template to override the built-in one.
## Use cases
- Add custom `[Unit]` dependencies (`Requires=`, `After=docker.service`, etc.)
- Set environment variables (`Environment=`, `EnvironmentFile=`)
- Change restart policy, timeouts, resource limits
- Add `ExecStartPre` / `ExecStartPost` hooks
## Proposed config
```yaml
template: /etc/unitdore/unit.service.tmpl # optional path to custom template
```
Template uses Go `text/template` with the same `templateData` struct already in `systemd/generator.go`. Built-in template is used as fallback if no custom template is set.
## Per-unit override
Also consider allowing per-unit template overrides:
```yaml
units:
- name: nginx
template: /etc/unitdore/templates/nginx.service.tmpl
```
With this feature we must have the ability to get all the variables we can use. maybe a list-variables command that lists the [variable name] and what it does and is for.
With this feature we must have the ability to get all the variables we can use. maybe a list-variables command that lists the [variable name] and what it does and is for.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Allow users to provide their own
.servicefile template to override the built-in one.Use cases
[Unit]dependencies (Requires=,After=docker.service, etc.)Environment=,EnvironmentFile=)ExecStartPre/ExecStartPosthooksProposed config
Template uses Go
text/templatewith the sametemplateDatastruct already insystemd/generator.go. Built-in template is used as fallback if no custom template is set.Per-unit override
Also consider allowing per-unit template overrides:
With this feature we must have the ability to get all the variables we can use. maybe a list-variables command that lists the [variable name] and what it does and is for.