Repository navigation
Why isn't my custom systemd service picked up by Beszel? #1820
|
Hello all I have some custom systemd services that I've created, which can be shown as below: My knowledge of Linux isn't great by any means, but if these two timers have corresponding services, doesn't this mean they should be picked up by Beszel? However, when I look at the list of Systemd Services in Beszel, neither of these two services/timers show up. What kind of services does Beszel look at specifically? And what are my services lacking that means they don't get picked up by Beszel? This is what one of my service files looks like: And if it helps, this is what my Beszel agent docker-compose looks like: beszel-agent:
image: ghcr.io/henrygd/beszel/beszel-agent:latest
container_name: beszel-agent
restart: unless-stopped
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./beszel_agent_data:/var/lib/beszel-agent
- ./beszel_socket:/beszel_socket
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro
- /var/run/systemd/private:/var/run/systemd/private:ro
environment:
LISTEN: 45876
KEY: [redacted]
TOKEN: [redacted]
HUB_URL: [redacted]
devices:
- /dev/sda:/dev/sda
cap_add:
- SYS_RAWIO # required for S.M.A.R.T. data
security_opt:
- apparmor:unconfined
healthcheck:
test: ['CMD', '/agent', 'health']
interval: 120sAny clarification on how Beszel's systemd service detection works would be greatly appreciated! |
Replies: 3 comments 7 replies
|
The agent explicitly skips any service where You can check this by running |
|
To add on to what Sven said, the key is whether the unit is actually loaded. If it shows up using systemctl list-units '*myservice*'For For non-oneshot, it should automatically be loaded if there's an active timer associated w/ the service. In the current version, timers are not monitored. I changed this in the next version so you can opt into monitoring timers by defining them in |
|
This limitation affects timer-triggered Type=oneshot services. Once the job completes, ActiveEnterTimestamp resets to zero, so the service disappears from Beszel, even when its last run failed. Monitoring the timer only shows that the schedule is active; it does not expose the result of the last invocation. It would be useful to retain loaded oneshot services after they have run, using properties such as ExecMainStartTimestamp, ExecMainStatus, Result, and the last exit timestamp. The UI could show them as inactive/failed while retaining their last execution result. The proposed RemainAfterExit=yes workaround is unsuitable for timer-triggered jobs because it leaves the service active after completion, preventing subsequent timer activations from rerunning it. |
The agent explicitly skips any service where
ActiveEnterTimestampis 0. ForType=oneshotservices (especially withRemainAfterExit=no, which is the default), once the service finishes and returns toinactive/deadstate, systemd resetsActiveEnterTimestampto 0. This is different from long-running services that remain in the active state.You can check this by running
systemctl show weekly-docker-updater.service --property=ActiveEnterTimestamp