Skip to content
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

sv.c: Avoid masking service status with log status #21

Closed
wants to merge 1 commit into from
Closed

sv.c: Avoid masking service status with log status #21

wants to merge 1 commit into from

Conversation

Goorzhel
Copy link

@Goorzhel Goorzhel commented Aug 6, 2022

Use log status only if service is okay but log isn't. In all other
cases, use service status.

Fixes #20.

Before
❯ xbps-query runit | ag 'repo|pkgver'
pkgver: runit-2.1.2_11
repository: https://repo-us.voidlinux.org/current
❯ fd -t f . /etc/sv/issue-20 -X head    
==> /etc/sv/issue-20/run <==
#!/bin/sh
echo 'Sleeping for 60 seconds.'
exec /usr/bin/sleep 60

==> /etc/sv/issue-20/log/run <==
#!/bin/sh
exec /usr/bin/false
❯ ls -l /etc/init.d/issue-20 
lrwxrwxrwx 1 root root 11 Aug  5 18:09 /etc/init.d/issue-20 -> /usr/bin/sv
❯ sudo /etc/init.d/issue-20 status
run: issue-20: (pid 8220) 44s; down: log: 1s, normally up, want up
❯ echo $?  # expecting 0
3
After
❯ xbps-query runit | ag 'repo|pkgver'
pkgver: runit-2.1.2_12
repository: /tmp/xdowngrade-2022-08-05.p555tSVo
❯ sudo /etc/init.d/issue-20 status
run: issue-20: (pid 21075) 30s; down: log: 0s, normally up, want up
❯ echo $?
0

Use log status only if service is okay but log isn't. In all other
cases, use service status.
@Goorzhel
Copy link
Author

Goorzhel commented Aug 6, 2022

@ahesford
@ericonr

@Goorzhel Goorzhel closed this by deleting the head repository Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sv status exit code for service masked by its log
1 participant