Bug 1043184

Summary: squid fails to restart due to not being able to read pid file from old instance
Product: [Fedora] Fedora Reporter: Tom Hughes <tom>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dwalsh, tom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-16 10:03:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tom Hughes 2013-12-14 18:00:49 UTC
Squid fails to restart due to an AVC reading /var/run/squid.pid:

time->Sat Dec 14 17:54:31 2013
type=SYSCALL msg=audit(1387043671.678:8259): arch=40000003 syscall=5 success=no exit=-13 a0=b9367440 a1=8000 a2=1b6 a3=b942b780 items=0 ppid=1 pid=4950 auid=4294967295 uid=23 gid=23 euid=0 suid=0 fsuid=0 egid=23 sgid=23 fsgid=23 ses=4294967295 tty=(none) comm="squid" exe="/usr/sbin/squid" subj=system_u:system_r:squid_t:s0 key=(null)
type=AVC msg=audit(1387043671.678:8259): avc:  denied  { read } for  pid=4950 comm="squid" name="squid.pid" dev="tmpfs" ino=20196 scontext=system_u:system_r:squid_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file

Comment 1 Miroslav Grepl 2013-12-16 10:03:12 UTC
Did you run squid by hand? 

Please execute

# restorecon -R -v /var/run/squid.pid

to fix the labeling and reopen if this happens again.

Comment 2 Tom Hughes 2013-12-16 10:08:58 UTC
I hadn't knowingly started it by hand, no.

I had upgraded to F20 on Friday, then on Saturday there was a squid update pushed and when yum installed it and tried to restart squid the restart failed.

Labelling seems to be right now anyway:

gosford [~] % ls -Z /var/run/squid.pid
-rw-r--r--. root squid system_u:object_r:squid_var_run_t:s0 /var/run/squid.pid
gosford [~] % sudo restorecon -R -v /var/run/squid.pid
[sudo] password for tom: 
gosford [~] % ls -Z /var/run/squid.pid                
-rw-r--r--. root squid system_u:object_r:squid_var_run_t:s0 /var/run/squid.pid

and indeed doing a "systemctl restart squid" works so it looks like it has worked itself out.

Comment 3 Miroslav Grepl 2013-12-16 10:23:52 UTC
Ok, please reopen if this happens again. Thank you.