Project

Profile

Help

Issue #670

closed

init scripts pulp_workers and pulp_celerybeat check number of blocks instead of file permissions on /etc/default/pulp_workers

Added by moritz.rogalli@klarna.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.5
Platform Release:
2.6.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

diff for fixing pulp_workers and pulp_celerybeat init scripts

Description of problem:

The init scripts for pulp_workers and pulp_celerybeat have a sanity check that verifies file permissions on the respective file in /etc/default/.

The scripts execute

local perm=$(stat -Lt "$path" | awk '{print $3}')

to get the permissions. This is afaik the block number instead of the permissions.

This worked fine until we switched the underlying disk when blocks went from 8 to 16 for the file /etc/pulp_workers.

use "0$(stat -c %a)" and $(stat -c %u) for owner looks better and works.

Version-Release number of selected component (if applicable): 2.5.1

How reproducible:

Have a /etc/defaults/pulp_workers file with 16 blocks in the file system.

Steps to Reproduce:
1. make sure 'stat /etc/default/pulp_workers' reports "Blocks: 16"
2. run service pulp_workers start

Actual results:

service pulp_workers status
celery init v10.0.
Error: Config script '/etc/default/pulp_workers' cannot be writable by group!

Resolution:
Review the file carefully and make sure it has not been
modified with malicious intent. When sure the
script is safe to execute with superuser privileges
you can change the scripts permissions:
$ sudo chmod 640 '/etc/default/pulp_workers'

Expected results:

celery init v10.0.
node celery is stopped...
node reserved_resource_worker-0 is stopped...

or running or whatever state the workers are in.

Additional info:

centos-6

+ This bug was cloned from Bugzilla Bug #1183706 +


Files

c093ca366025718fdcdca91ce48b2fcf (200 Bytes) c093ca366025718fdcdca91ce48b2fcf moritz.rogalli@klarna.com, 03/01/2015 12:20 AM

Also available in: Atom PDF