[Unit] Description=The osquery Daemon After=network.service syslog.service [Service] TimeoutStartSec=0 EnvironmentFile=/etc/conf.d/osqueryd ExecStartPre=/bin/sh -c "if [ ! -f $FLAG_FILE ]; then touch $FLAG_FILE; fi" ExecStartPre=/bin/sh -c "if [ -f $OLD_PIDFILE ]; then mv $OLD_PIDFILE $PIDFILE; fi" ExecStart=/usr/bin/osqueryd \ --flagfile $FLAG_FILE \ --config_path $CONFIG_FILE Restart=on-failure KillMode=process KillSignal=SIGTERM [Install] WantedBy=multi-user.target