From: Konstantin Lepikhov <lepikhov@energya.ru>
To: mandrake-russian@altlinux.ru
Subject: [mdk-re] Re: adduser в spec-файле
Date: Mon Apr 15 22:52:11 2002
Message-ID: <20020415184558.GB11490@lks.home> (raw)
In-Reply-To: <200204151519.UAA10165@ns.esoo.ru>
Hi vic!
Monday 15, at 09:19:15 PM you wrote:
> Как можно сделать добавление пользователя при установке РПМ-пакета?
> Насколько я понял ,это делается в секции %pre?
> И как сделать так , чтобы в случае, если нужный пользователь уже существует в
> системе, инсталляция не прерывалась с ошибкой, а корректно обрабатывалась
> данная ситуация?
>
> В таком примере :
> -----------------------------------------------------------
> %pre
> /usr/sbin/groupadd -r -f mail &>/dev/null
> /usr/sbin/useradd -r -n -d /dev/null -s /dev/null cyrus&>/dev/null
> ----------------------------------------------------------
> если пользователь cyrus уже существует, rpm -i cyrus-imapd.rpm вываливается с
> ошибкой, что такой пользователь уже существует.
>
А так не сгодится?
id %{name} > /dev/null 2>&1
if [ $? -eq 1 ]; then
/usr/sbin/useradd -d %{_sysconfdir}/%{name} -r -s "" %{name} > /dev/null
fi
(взято из spec'а privoxy)
--
with best regards, ICQ: 109916175
Konstantin Lepikhov mailto:lakostis@pisem.net.nospam
Motto: Linux is like a wigwam - no windows, no gates, apache inside!
next prev parent reply other threads:[~2002-04-15 22:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-15 19:19 [mdk-re] " vic ismakaev
2002-04-15 22:52 ` Konstantin Lepikhov [this message]
2002-04-16 6:32 ` [mdk-re] " vic ismakaev
2002-04-16 8:53 ` [mdk-re] Fetchmailrc & Spam Letter Tihonov Vladimir
2002-04-16 9:19 ` [mdk-re] Re: adduser в spec-файле Yura Zotov
2002-04-16 9:27 ` vic ismakaev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020415184558.GB11490@lks.home \
--to=lepikhov@energya.ru \
--cc=mandrake-russian@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git