Re: In the systemd scheme, where should startup/stop scripts for things systemd can't handle go?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

On 07/27/2012 02:24 PM, Damjan wrote:
>> So now that I've got a network through systemd, I ran into
>> trouble with some daemon service files that I crafted by hand.
>> 
>> None of the following directives will work (culled from different
>> files):
>> 
>> ExecStartPre=cd /etc/solr
> 
> Use: WorkingDirectory=
> 
>> ExecStart=$JAVA_HOME/bin/java -jar $JAVA_OPTS start.jar
>> $JETTY_OPTS >> /var/log/jetty.log 2>&1
> 
> You shouldn't redirect stdout/stderr, let systemd handle it
> 
> see StandardInput=, StandardOutput=, StandardError= in man
> systemd.exec
> 
> 
>> ExecStop=kill `pidof -o %PPID /usr/sbin/dictd` 2>/dev/null
>> 1>/dev/null
> 
> I don't know what's that "kill dictd" but if it's a subprocess
> started from your java program, systemd can handle it too. It puts
> every service in its own CGroup so it know all the processes
> started from that service. See man systemd.kill KillMode=
> 
Thanks for all the help here. 'cause I'm clueless.

Here's what I've got for dictd (which seems like a relatively simple
case):

[Unit]
Description=Dict Server
After=network.target

[Service]
Type=simple
EnvironmentFile=/etc/conf.d/dictd
ExecStart=/usr/sbin/dictd ${DICTD_ARGS} -- ${DICTD_EARGS}
Restart=always

[Install]
WantedBy=multi-user.target

Is this making sense?

Thanks!
- -- 
David Benfell
benfell@xxxxxxxxxxxxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJQExIdAAoJELT202JKF+xpbPIP/R1KB2d62nnil+BF1rLrz5oB
Fu9AtOodoS9IQnj1duM+PNDbSa55ePuL/HsoNEgRQ2PxrR906DhrHciIP3VeT01M
Ll2MX44nvsCpn+s4zDjJMxIy5F5yp0UWSrG1zPNmYLoTH4Zd50JyNCYq0xrj+9kM
K1qPI/RRHNYJXZJ31dih3D0AV3l8iGzjzfIn+toYQsy+KDjRkg8+73ZPoIpmYACt
DdraX+25QxAV6H91eFj27sk101Q6NG4GER3VeZbxTAIYTnOsfEEZjlFDslSXaLV3
OCVZGHkbuKxxMDFphm84S52oVRkFy8XJagJ76+DeMbwH7a44f/Q31dV8hXqrJiIT
EBFJEes1GtkiatmMM9UREaVsE45cFAcVdGA+NWsy6/j0P8E8y9tfGSCytIChEZcr
yn0sSFITuAi8kSgePD0KpTKV6lZlGoqkWfIeoeXtY0oXVJDx3O1s9CS3N5I5mp1i
YI33cXbcpWpvKRsSvOPdeT5gDyQubAkLwWq+dFZ2C3WRDh6eIkeEyQEnpjJUlYSb
GmFHJR1je3Z96kOdcr8EUwci+T6F4oTu2iXFWrcWggPHi8xIjsm+2dvRI/9VJ8iT
U6w1RU4wbk8wB0e+EzehcziXpufeYrpQF5LF6TMOAEeN8A4yVjUcTf7/URRAU1IK
tBliDW0dTGJl8U920mZ3
=yv1o
-----END PGP SIGNATURE-----

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux