From: Yura Zotov <yznews@hotbox.ru>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] Re: adduser в spec-файле
Date: Tue Apr 16 09:19:20 2002
Message-ID: <20020416051858.GA7757@home-pool4-66.com2com.ru> (raw)
In-Reply-To: <200204160228.HAA00833@ns.esoo.ru>
On Tue, Apr 16, 2002 at 08:28:15AM +0600, vic ismakaev wrote:
> 16 Апрель 2002 00:45, Вы написали:
> > 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)
> Спасибо!
> Я сделал так ,как в спеке постфикса.
> /usr/sbin/useradd -r -n -d /dev/null -s /dev/null cyrus&>/dev/null ||:
> ^^^ -правда,что значит эта
> комбинация,не нашел
&> - перенаправить все потоки вывода в файл
|| - если команда завершилась неудачно, то будет выполнена
команда, написанная справа от опретора "||".
--
Юрий А. Зотов
next prev parent reply other threads:[~2002-04-16 9:19 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 ` [mdk-re] " Konstantin Lepikhov
2002-04-16 6:32 ` vic ismakaev
2002-04-16 8:53 ` [mdk-re] Fetchmailrc & Spam Letter Tihonov Vladimir
2002-04-16 9:19 ` Yura Zotov [this message]
2002-04-16 9:27 ` [mdk-re] Re: adduser в spec-файле 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=20020416051858.GA7757@home-pool4-66.com2com.ru \
--to=yznews@hotbox.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