Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
squid systemd startup script [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Nreal
Apprentice
Apprentice


Joined: 06 Jan 2009
Posts: 265

PostPosted: Sat Jul 21, 2018 9:08 am    Post subject: squid systemd startup script [solved] Reply with quote

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
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30914
Location: here

PostPosted: Sat Jul 21, 2018 9:25 am    Post subject: Reply with quote

There is a bug with proposed squid.service
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Nreal
Apprentice
Apprentice


Joined: 06 Jan 2009
Posts: 265

PostPosted: Sat Jul 21, 2018 9:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum