remote_syslog2 icon indicating copy to clipboard operation
remote_syslog2 copied to clipboard

systemd init script fails on boot on CentOS 7

Open leonsodhi opened this issue 9 years ago • 3 comments

[root@NAME]# systemctl status remote_syslog 
remote_syslog.service - remote_syslog2 
Loaded: loaded (/etc/systemd/system/remote_syslog.service; enabled; vendor preset: disabled) 
Active: failed (Result: start-limit) since Mon 2016-05-09 14:15:19 UTC; 5min ago 
Docs: https://github.com/papertrail/remote_syslog2 
Process: 1118 ExecStart=/usr/local/bin/remote_syslog -D (code=exited, status=1/FAILURE) 
Process: 1115 ExecStartPre=/usr/bin/test -e /etc/log_files.yml (code=exited, status=0/SUCCESS) 
Main PID: 1118 (code=exited, status=1/FAILURE) 

May 09 14:15:19 NAME systemd[1]: Unit remote_syslog.service entered failed state. 
May 09 14:15:19 NAME systemd[1]: remote_syslog.service failed. 
May 09 14:15:19 NAME systemd[1]: remote_syslog.service holdoff time over, scheduling restart. 
May 09 14:15:19 NAME systemd[1]: start request repeated too quickly for remote_syslog.service 
May 09 14:15:19 NAME systemd[1]: Failed to start remote_syslog2. 
May 09 14:15:19 NAME systemd[1]: Unit remote_syslog.service entered failed state. 
May 09 14:15:19 NAME systemd[1]: remote_syslog.service failed. 

Works fine if started after the system is up and running.

leonsodhi avatar May 10 '16 01:05 leonsodhi

Has rsyslog.service started at this point?

johlym avatar May 27 '16 23:05 johlym

For me the problem was in these two lines:

[Service]
ExecStartPre=/usr/bin/test -e /etc/log_files.yml
ExecStart=/usr/local/bin/remote_syslog -D
Restart=always
User=root  <---- 1
Group=root <---- 2

Looks like you can use root as user name and group name at the same time.

The error was

 remote_syslog2.service: Failed at step USER spawning /usr/bin/test: No such process

ivanovv avatar May 14 '20 23:05 ivanovv

Good catch @ivanovv. Unfortunately, I don't maintain this since I don't work at Papertrail anymore, but still super helpful.

johlym avatar May 15 '20 00:05 johlym