<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I'm trying to switch from an init.d script to a system service and having problems getting the service to run.<div class="">The syslog-ng service gets timed out and never starts up.</div><div class=""><br class=""></div><div class="">My service looks like this:</div><div class=""><div class="">[Unit]</div><div class="">Description="Syslog-ng an enhanced syslog"</div><div class="">Documentation=man:syslog-ng(8)</div><div class="">After=network.target</div><div class="">ConditionFileNotEmpty=/opt/syslog-ng/etc/syslog-ng.conf</div><div class=""><br class=""></div><div class="">[Service]</div><div class="">Type=notify</div><div class="">ExecStart=/opt/syslog-ng/sbin/syslog-ng --no-caps -p /var/run/syslogd.pid -rdvt</div><div class="">ExecReload=/bin/kill -HUP $MAINPID</div><div class="">StandardOutput=journal</div><div class="">StandardError=journal</div><div class="">Restart=on-failure</div><div class="">Environment=LD_LIBRARY_PATH=/usr/lib/jvm/java/jre/lib/amd64/server:$LD_LIBRARY_PATH</div><div class=""><br class=""></div><div class="">[Install]</div><div class="">WantedBy=multi-user.target</div><div class=""><br class=""></div><div class="">My config looks like this:</div><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Menlo';font-size:9.0pt;" class=""><span style="color:#808080;background-color:#232525;" class="">#############################################################################<br class=""></span><span style="color:#808080;background-color:#232525;" class=""># Default syslog-ng.conf.partial file which collects all local logs into a<br class=""></span><span style="color:#808080;background-color:#232525;" class=""># single file called /var/log/messages.<br class=""></span><span style="color:#808080;background-color:#232525;" class="">#<br class=""></span><span style="color:#808080;background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">@version: </span><span style="color:#6a8759;background-color:#232525;" class="">3.16<br class=""></span><span style="background-color:#232525;" class="">@module </span><span style="color:#6a8759;background-color:#232525;" class="">"mod-java"<br class=""></span><span style="background-color:#232525;" class="">@include </span><span style="color:#6a8759;background-color:#232525;" class="">"scl.conf"<br class=""></span><span style="background-color:#232525;" class="">@include </span><span style="color:#6a8759;background-color:#232525;" class="">"conf.d/gc-parsers.conf"<br class=""></span><span style="color:#6a8759;background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">source </span><span style="color:#6a8759;background-color:#232525;" class="">s_internal {internal();};<br class=""></span><span style="color:#6a8759;background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">source </span><span style="color:#6a8759;background-color:#232525;" class="">s_rtl_stream {<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">unix-stream("/var/gamecircus/log/rtl-stream.sock" </span><span style="color:#6a8759;background-color:#232525;" class="">flags(no-parse) log_msg_size(1000000));<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="color:#808080;background-color:#232525;" class=""># Backup for when syslog-ng crashes and doesn't restart queues the messages<br class=""></span><span style="background-color:#232525;" class="">source </span><span style="color:#6a8759;background-color:#232525;" class="">s_rtl_backup {<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">file("/var/gamecircus/log/rtl-backup.log" </span><span style="color:#6a8759;background-color:#232525;" class="">flags(no-parse) log_msg_size(1000000));<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">destination </span><span style="color:#6a8759;background-color:#232525;" class="">d_kafka_unstructured {<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">kafka </span><span style="color:#6a8759;background-color:#232525;" class="">(<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">        </span><span style="background-color:#232525;" class="">client-lib-dir("/opt/syslog-ng/lib/syslog-ng/java-modules/:</span><span style="color:#6a8759;background-color:#232525;" class="">/opt/kafka/libs/")<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">        </span><span style="background-color:#232525;" class="">kafka-bootstrap-servers(<redacted></span><span style="color:#6a8759;background-color:#232525;" class="">)<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">        </span><span style="background-color:#232525;" class="">topic("syslog-ng-`DeployedEnvironment`")<br class=""></span><span style="background-color:#232525;" class="">    );<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">destination </span><span style="color:#6a8759;background-color:#232525;" class="">d_kafka_structured {<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">kafka </span><span style="color:#6a8759;background-color:#232525;" class="">(<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">        </span><span style="background-color:#232525;" class="">client-lib-dir("/opt/syslog-ng/lib/syslog-ng/java-modules/:</span><span style="color:#6a8759;background-color:#232525;" class="">/opt/kafka/libs/")<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">        </span><span style="background-color:#232525;" class="">kafka-bootstrap-servers(<redacted></span><span style="color:#6a8759;background-color:#232525;" class="">)<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">        </span><span style="background-color:#232525;" class="">topic("${topic}.${environment}")<br class=""></span><span style="background-color:#232525;" class="">        template("$(format-json </span><span style="color:#6a8759;background-color:#232525;" class="">--scope nv_pairs --exclude MESSAGE)\n")<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">);<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">destination </span><span style="color:#6a8759;background-color:#232525;" class="">d_syslog_ng {<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">file("/var/log/syslog-ng");<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">parser </span><span style="color:#6a8759;background-color:#232525;" class="">p_json { json-parser(); };<br class=""></span><span style="color:#6a8759;background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">log </span><span style="color:#6a8759;background-color:#232525;" class="">{<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">source(s_internal);<br class=""></span><span style="background-color:#232525;" class="">    destination(d_syslog_ng);<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">log </span><span style="color:#6a8759;background-color:#232525;" class="">{<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">source(s_rtl_stream);<br class=""></span><span style="background-color:#232525;" class="">    parser(p_json);<br class=""></span><span style="background-color:#232525;" class="">    destination(d_kafka_structured);<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="background-color:#232525;" class="">log </span><span style="color:#6a8759;background-color:#232525;" class="">{<br class=""></span><span style="color:#6a8759;background-color:#232525;" class="">    </span><span style="background-color:#232525;" class="">source(s_rtl_backup);<br class=""></span><span style="background-color:#232525;" class="">    parser(p_json);<br class=""></span><span style="background-color:#232525;" class="">    destination(d_kafka_structured);<br class=""></span><span style="background-color:#232525;" class="">};<br class=""></span><span style="background-color:#232525;" class=""><br class=""></span><span style="color:#808080;background-color:#232525;" class=""># Build script will add stuff below for the specific build.<br class=""></span><span style="color:#808080;background-color:#232525;" class="">###############################################################################</span></pre><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The logging that I turned on in the service above isbn't helping. Here's the last little bit</div><div class=""><br class=""></div><div class=""><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.217091] Add path to classpath: /opt/kafka/libs/kafka-streams-0.11.0.0.jar;</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.217248] Add path to classpath: /opt/kafka/libs/rocksdbjni-5.0.1.jar;</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.217309] Add path to classpath: /opt/kafka/libs/kafka-streams-examples-0.11.0.0.jar;</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.361062] Add path to classpath: /opt/syslog-ng/lib/syslog-ng/java-modules/syslog-ng-core.jar;</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.365718] Running application hooks; hook='1'</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.365930] Running application hooks; hook='3'</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.366137] syslog-ng starting up; version='3.16.1'</div><div class="">May 16 15:10:13 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:10:13.366480] Worker thread started; driver='d_kafka_structured#0'</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal systemd[1]: syslog-ng.service start operation timed out. Terminating.</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:11:43.273058] Running application hooks; hook='4'</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:11:43.273074] syslog-ng shutting down; version='3.16.1'</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:11:43.376882] Worker thread finished; driver='d_kafka_structured#0'</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:11:43.377030] Closing log transport fd; fd='92'</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:11:43.377186] Java machine free;</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal syslog-ng[23866]: [2019-05-16T15:11:43.378858] Running application hooks; hook='5'</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal systemd[1]: Failed to start "Syslog-ng an enhanced syslog".</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal systemd[1]: Unit syslog-ng.service entered failed state.</div><div class="">May 16 15:11:43 ip-172-30-6-13.ec2.internal systemd[1]: syslog-ng.service failed.</div></div><div class=""><br class=""></div><div class="">Any suggestions on what me causing it to timeout? I'm new to Ssytemd but if I understand the notify type it would suggest that syslog-ng isn't notifying systemd that it's started. I'm not sure what would be holding it up.</div><div class=""><br class=""></div><div class="">Any help is much appreciated.</div><div class=""><br class=""></div><div class=""><span style="color: rgb(0, 0, 0); orphans: 2; text-align: -webkit-auto; widows: 2;" class="">Ronald Fenner</span></div><div class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">Network Architect</div><div class="">Game Circus LLC.</div></div><div class=""><br class=""></div><div class=""><a href="mailto:rfenner@gamecircus.com" class="">rfenner@gamecircus.com</a></div></div></div></div>
</div>
<br class=""></div></body></html>