You are not logged in.
Does Arch have any tool to check what services needs restart after software update just like `checkrestart` from Debian flavoured distros or `needs-restarting` from Red Hat ones?
Offline
I don't know of an Arch specific solution, and I think this should be handled by systemd (if you cannot find anything in the systemd documentation, open a bug report and request the feature). Until then, look at the result of a quick google query: http://ingvar.blog.redpill-linpro.com/2 … o-restart/
Offline
This command which could be improved with awk should display all processes which rely on a deleted/updated file. Then you only need to find the corresponding systemd service or maybe restart your x session
ps -p "$(sudo lsof -F pf | grep -a "^p\|^fDEL$" | uniq | grep -B1 "^fDEL$" | sed -n "s/^p\(.*\)/\1/p" | sort -n | uniq | tr \\n ' ' | sed 's/ *$//')"
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
I got
PID TTY TIME CMD
242 ? 00:00:04 X
322 pts/3 00:00:27 mpv
382 pts/2 00:01:19 firefox
after a restart.
Why?
Offline
Maybe there is some other temporary file that is not a library but deleted that slips through. I got my awk version now to replace my old hack code.
__pids="$(sudo lsof -F pfn |
awk '
/^n/{
# if this file is a deleted library or binary, show it
if (del == 1 && match($0, "bin|lib")) {
print pid;
del=0;
}
del = 0;
}
/^fDEL$/{
# the next file is deleted
del = 1;
}
/^p/{
# we check a new process
del = 0
pid = substr($0, 2)
}' |
sort -un |
paste -sd ' '
)" && [ -n "$__pids" ] && ps -p "$__pids" && unset __pids || unset __pids
Edit: Reorder logic, don't execute ps if no processes are found.
Last edited by progandy (2014-06-12 16:42:27)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
$ ./script
error: list of process IDs must follow -p
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
Offline