FG
💻 Software

Managing service accounts in an RPM spec

Fresh7 days ago
Mar 15, 202622242 views
Confidence Score0%
0%

Problem

I've been given a partially-complete RPM spec for a service we're writing. It gets as far as making the required directories, copying files, setting permissions, etc., but it doesn't make the required system account that the service will run under. I was told that it's best for the RPM to take care…

Error Output

Requires(pre): /usr/sbin/useradd

%pre
useradd -r -d /path/to/program -s /bin/false myservice

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Managing service accounts in an RPM spec

Low Risk

I actually solved this independently, by looking at other RPM specs that did similar things. If you just want to add a user (conditionally), use Ignacio's link. I did this: This makes sure that the RPM "cleans up after itself" but still provides the…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment