mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +03:00
Merge pull request #26324 from yuwata/argv-util-update-short-name
argv-util: also update short invocation name
This commit is contained in:
commit
8586e8ab84
@ -192,6 +192,10 @@ int rename_process(const char name[]) {
|
||||
strncpy(program_invocation_name, name, k);
|
||||
if (l > k)
|
||||
truncated = true;
|
||||
|
||||
/* Also update the short name. */
|
||||
char *p = strrchr(program_invocation_name, '/');
|
||||
program_invocation_short_name = p ? p + 1 : program_invocation_name;
|
||||
}
|
||||
|
||||
/* Third step, completely replace the argv[] array the kernel maintains for us. This requires privileges, but
|
||||
|
@ -3,3 +3,4 @@ Description=Log filtering unit
|
||||
|
||||
[Service]
|
||||
ExecStart=sh -c 'while true; do echo "Logging from the service, and ~more~"; sleep .25; done'
|
||||
SyslogLevel=notice
|
||||
|
@ -199,7 +199,7 @@ function run_service_and_fetch_logs() {
|
||||
journalctl --sync
|
||||
END=$(date '+%Y-%m-%d %T.%6N')
|
||||
|
||||
journalctl -q -u "$UNIT" -S "$START" -U "$END" | grep -Pv "systemd\[[0-9]+\]"
|
||||
journalctl -q -u "$UNIT" -S "$START" -U "$END" -p notice
|
||||
systemctl stop "$UNIT"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user