[Bug 802635] New: systemctl start squid fails to create squid swap directories
https://bugzilla.novell.com/show_bug.cgi?id=802635 https://bugzilla.novell.com/show_bug.cgi?id=802635#c0 Summary: systemctl start squid fails to create squid swap directories Classification: openSUSE Product: openSUSE 12.3 Version: RC 1 Platform: x86-64 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: mpluskal@suse.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- When starting squid for the first time (systemctl start squid), squid swap directory is not created, therefore squid fails to start. It is necessary to manually issue "squid -z" and than everything works. /usr/lib/systemd/system/squid.service seems to be correct: [Service] EnvironmentFile=/etc/sysconfig/squid ExecStartPre=/usr/sbin/squid_cache_swap.sh ... executing /usr/sbin/squid_cache_swap.sh leads to creation of swap cache in proper place - it however seems that for some reason it is not executed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c
Christian Boltz
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c1
Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c2
--- Comment #2 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c3
Christian Wittmer
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c4
--- Comment #4 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c5
--- Comment #5 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c6
--- Comment #6 from Christian Boltz
ExecStartPre=/bin/sh -c "test ! -d `sed -e 's/#.*//g' /etc/squid/squid.conf | grep cache_dir | awk '{ print $3 }'`/00 && /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf || exit 0"
Impressive command line ;-) If I understand it correct, it gets the cache_dir from squid.conf and, if the directory doesn't exist, it starts squid with some params (I guess to create the cache dir - but I know nothing about squid ;-) May I propose to make the commandline a bit less expressive? ;-) - sed can grep itsself - the || exit 0 is probably not needed if you use "test -d" instead of "test ! -d" and then "|| /usr/sbin/squid" instead of "&& ..." (difference: if the squid call fails, you'll get a different exitcode) The following line contains these two changes (warning: untested!) ExecStartPre=/bin/sh -c "test -d `sed -en '/cache_dir/ s/#.*//g' /etc/squid/squid.conf | awk '{ print $3 }'`/00 || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf" In theory you can also get rid of awk, but that makes sed more interesting[tm]. Maybe you can use "cut" instead of awk? (depends on the config file format) You might also want to make /cache_dir/ more specific to avoid that it matches for example "foo_cache_dir_bar". Maybe something like /^cache_dir / - but again this depends on the config file format and how strict it is parsed by squid. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c7
--- Comment #7 from Christian Boltz
(In reply to comment #4) The following line contains these two changes (warning: untested!)
ExecStartPre=/bin/sh -c "test -d `sed -en '/cache_dir/ s/#.*//g' /etc/squid/squid.conf | awk '{ print $3 }'`/00 || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf"
Oops, I forgot a "p" for sed :-( Try this one: ExecStartPre=/bin/sh -c "test -d `sed -en '/cache_dir/ s/#.*//gp' /etc/squid/squid.conf | awk '{ print $3 }'`/00 || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c8
--- Comment #8 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c9
--- Comment #9 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c10
Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c
Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c11
Martin Pluskal
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c12
Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c13
--- Comment #13 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c14
--- Comment #14 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c15
Martin Pluskal
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c16
Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c17
Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c18
Benjamin Brunner
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c19
--- Comment #19 from Christian Boltz
Can you please check the squid.service file? The SR contains +ExecStart=/usr/sbin/squi etF $SQUID_START_OPTIONS -f /etc/squid/squid.conf and I'd expect /usr/sbin/squi_d_ there ;-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c20
--- Comment #20 from Christian Boltz
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c21
--- Comment #21 from Bruno Friedmann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c22
--- Comment #22 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c23
Benjamin Brunner
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c
Martin Pluskal
https://bugzilla.novell.com/show_bug.cgi?id=802635
https://bugzilla.novell.com/show_bug.cgi?id=802635#c24
--- Comment #24 from Swamp Workflow Management
participants (1)
-
bugzilla_noreply@novell.com