View previous topic :: View next topic |
Author |
Message |
Nreal Apprentice
Joined: 06 Jan 2009 Posts: 265
|
Posted: Sat Jul 21, 2018 9:08 am Post subject: squid systemd startup script [solved] |
|
|
Hello
So squid doesnt install with systemctl script - is there a howto somewhere how a noob could create one?
Code: | # systemctl start squid
Failed to start squid.service: Unit squid.service not found. |
/etc/init.d used to always do the trick..
Last edited by Nreal on Sat Jul 21, 2018 9:40 am; edited 1 time in total |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30914 Location: here
|
|
Back to top |
|
|
Nreal Apprentice
Joined: 06 Jan 2009 Posts: 265
|
Posted: Sat Jul 21, 2018 9:40 am Post subject: |
|
|
Thanks, copied this + added Stop , not sure if its right though, but works for now.
Code: |
[Unit]
Description=Squid web caching proxy
After=syslog.target network.target network-online.target nss-lookup.target
[Service]
Environment="SQUID_CONF=/etc/squid/squid.conf"
Environment="SQUID_OPTS=-Y"
LimitNOFILE=16384
ExecStartPre=/usr/sbin/squid -N -z -f ${SQUID_CONF}
ExecStart=/usr/sbin/squid -N $SQUID_OPTS -f ${SQUID_CONF}
ExecReload=/usr/sbin/squid -k reconfigure -f ${SQUID_CONF}
ExecStop=/usr/sbin/squid -k shutdown $SQUID_OPTS -f ${SQUID_CONF}
# Note: Do NOT use ExecStop=/usr/sbin/squid -k shutdown -f ${SQUID_CONF}
# because it doesn't wait for squid to exit, causing systemd to SIGKILL squid
# right away which is certainly NOT what we want.
# Instead, enjoy the SIGTERM default which is identical to "squid -k shutdown"
# but without the nasty side effect of a (too early) SIGKILL.
#
# However per default, squid takes 30 seconds to exit which is acceptable but
# quite a long time. Fortunately, this can easily be changed to 1 second in
# /etc/squid/squid.conf: shutdown_lifetime 1 second
[Install]
WantedBy=multi-user.target
|
|
|
Back to top |
|
|
|