-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
pkgx and systemd unit #1018
Comments
To troubleshoot the permission error you're encountering with
Additionally, ensure that the If the issue persists, you can enable more detailed logging by setting the By following these steps, you should be able to identify and resolve the permission errors encountered by |
already checked all that, any other idea? |
To get more granular information about the permission errors, you can increase the verbosity level and ensure that all relevant environment variables and configurations are correctly set. Here are additional steps you can take:
By following these steps, you should be able to gather more detailed information about the permission errors and identify the specific file or directory causing the issue [1][2][3]. |
i modified the systemd unit to add an strace call [Unit]
Description=GitHub Actions Runner Manager (garm)
After=multi-user.target
[Service]
Type=simple
User=_garm
Group=_garm
#ProtectHome=false
Environment="PKGX_DIR=/var/run/garm/.pkgx"
Environment="HOME=/var/run/garm/"
RuntimeDirectory=garm
RuntimeDirectoryPreserve=yes
WorkingDirectory=%t
ExecStart=/usr/bin/strace -f -t -e trace=file /usr/local/bin/pkgx --verbose=2 +garm^${GARM_VERSION} garm -config ${GARM_CONFIG_PATH}
#ExecStart=/usr/local/bin/pkgx --verbose=2 +garm^${GARM_VERSION} garm -config ${GARM_CONFIG_PATH}
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStartSec=3600
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target ubuntu@github-actions-runner-manager:~$ sudo journalctl -xefu garm
...
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341968] 15:14:03 execve("/var/run/garm/.pkgx/github.com/cloudbase/garm/v0.1.4/bin/garm", ["/var/run/garm/.pkgx/github.com/c"..., "-config", "/etc/garm/config.toml"], 0x614086533990 /* 16 vars */) = -1 EACCES (Permission denied)
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341968] 15:14:03 statx(AT_FDCWD, "/var/run/garm/.pkgx/github.com/cloudbase/garm/v0.1.4/bin/garm", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0755, stx_size=20595785, ...}) = 0
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: × unexpected error
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: │ PermissionDenied
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: │ at default (file:///home/runner/work/pkgx/pkgx/src/utils/execve.ts:19:15)
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: │ at default (file:///home/runner/work/pkgx/pkgx/src/modes/x.ts:39:3)
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: │ at eventLoopTick (ext:core/01_core.js:182:7)
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: │ at async default (file:///home/runner/work/pkgx/pkgx/src/app.ts:48:11)
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: │ at async file:///home/runner/work/pkgx/pkgx/entrypoint.ts:59:3
Jun 27 15:14:03 github-actions-runner-manager strace[341968]: ╰─➤ https://github.com/pkgxdev/pkgx/issues/new
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341971] 15:14:03 +++ exited with 1 +++
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341976] 15:14:03 +++ exited with 1 +++
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341975] 15:14:03 +++ exited with 1 +++
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341970] 15:14:03 +++ exited with 1 +++
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: [pid 341969] 15:14:03 +++ exited with 1 +++
Jun 27 15:14:03 github-actions-runner-manager strace[341965]: 15:14:03 +++ exited with 1 +++
Jun 27 15:14:03 github-actions-runner-manager systemd[1]: garm.service: Main process exited, code=exited, status=1/FAILURE ubuntu@github-actions-runner-manager:~$ ls -alFh /etc/garm/
total 4.3M
drwxr-xr-x 3 _garm _garm 4.0K Jun 25 13:51 ./
drwxr-xr-x 108 root root 4.0K Jun 27 06:08 ../
-rw-r--r-- 1 _garm _garm 5.5K Jun 25 13:51 config.toml
-rw-r--r-- 1 _garm _garm 256K Jun 27 11:23 garm.db
-rw-r--r-- 1 _garm _garm 32K Jun 27 11:28 garm.db-shm
-rw-r--r-- 1 _garm _garm 4.0M Jun 27 11:28 garm.db-wal
drwxr-xr-x 3 _garm _garm 4.0K Jun 10 10:52 providers.d/ ubuntu@github-actions-runner-manager:~$ ls -alFh /var/run/garm/.pkgx/github.com/cloudbase/garm/v0.1.4/bin/garm
-rwxr-xr-x 1 _garm _garm 20M Jun 10 16:29 /var/run/garm/.pkgx/github.com/cloudbase/garm/v0.1.4/bin/garm* |
for posterity, cf https://manpages.ubuntu.com/manpages/bionic/man5/systemd.exec.5.html, a unit RuntimeDirectory= creates a subdir of /var/run that is linked, on ubuntu-24.04, on /run that is noexec. ubuntu@github-actions-runner-manager:~$ mount | grep '/run '
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=391176k,mode=755,inode64) ubuntu@github-actions-runner-manager:~$ ls -alFh /var/run
lrwxrwxrwx 1 root root 4 Jun 8 10:36 /var/run -> /run/ i make it work using CacheDirectory= instead of RuntimeDIrectory=. [Unit]
Description=GitHub Actions Runner Manager (garm)
After=multi-user.target
[Service]
Type=simple
User=_garm
Group=_garm
Environment="HOME=/var/cache/garm/"
ENvironment="PKGX_VERBOSE=0"
CacheDirectory=garm
# https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Specifiers
WorkingDirectory=%C
#ExecStart=/usr/bin/strace -f -t -e trace=file /usr/local/bin/pkgx --verbose="${PKGX_VERBOSE}" +garm^${GARM_VERSION} garm -config ${GARM_CONFIG_PATH}
ExecStart=/usr/local/bin/pkgx --verbose="${PKGX_VERBOSE}" +garm^${GARM_VERSION} garm -config ${GARM_CONFIG_PATH}
ExecReload=/bin/kill -HUP "${MAINPID}"
#TimeoutStartSec=3600
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target Maybe we could add a Systemd Unit section in the Wiki? |
I wonder if that's a better place, or a README.md in the package directory. |
in fact this is not specific to the garm package. the problem was with the need for systemd to execute (no-noexec) pkgx stuff. i thought the general documentation (github wiki or https://docs.pkgx.sh/) could help others to not loose their time with the same problem.
|
sure. we welcome the docs. |
Hi,
i try to use pkgx in a systemd unit for "GitHub Actions Runner Manager"
ubuntu@github-actions-runner-manager:~$ sudo cat /etc/systemd/system/garm.service
ubuntu@github-actions-runner-manager:~$ sudo cat /etc/systemd/system/garm.service.d/local.conf
ubuntu@github-actions-runner-manager:~$ ls -alFh /var/run/garm/ total 0 drwxr-xr-x 3 _garm _garm 60 Jun 27 11:53 ./ drwxr-xr-x 32 root root 1.1K Jun 27 11:53 ../ drwxr-xr-x 4 _garm _garm 80 Jun 27 11:53 .pkgx/
i got the following Permission error and do not have enough info to troubleshoot. any idea?
The text was updated successfully, but these errors were encountered: