FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 04-13-2011, 05:55 PM
Honza Horak
 
Default Systemd unit file implementation questions (ypbind)

Hi,

I'm working on systemd unit file for ypbind and found some problems,
that I'm not sure about:

1) if I use systemctl enable/disable instead of chkconfig in %post and
%preun sections in spec file, rpmlint prints errors:
postin-without-chkconfig /etc/rc.d/init.d/ypbind
preun-without-chkconfig /etc/rc.d/init.d/ypbind
Is this just rpmlint problem or should I change %post and %preun
sections somehow?

%post and %preun sections in spec file:

%post
/bin/systemctl enable %{name}.service || :

%preun
if [ $1 -eq 0 ] ; then
/bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
/bin/systemctl disable %{name}.service >/dev/null 2>&1 || :
fi


2) there is some code before and after starting the daemon in former
SysV init script, which should be executed even when using systemd unit
file. I created two scripts, placed them to /usr/lib/ypbind/ and add
them to "ExecStartPre:" in ypbind.service file. Is this correct solution
or there is a better one to execute more complicated scripts
before/after daemon script itself?

Regards,

Honza
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 06:00 PM
Michał Piotrowski
 
Default Systemd unit file implementation questions (ypbind)

Hi,

2011/4/13 Honza Horak <hhorak@redhat.com>:
> Hi,
>
> I'm working on systemd unit file for ypbind and found some problems,
> that I'm not sure about:
>
> 1) if I use systemctl enable/disable instead of chkconfig in %post and
> %preun sections in spec file, rpmlint prints errors:
> postin-without-chkconfig /etc/rc.d/init.d/ypbind
> preun-without-chkconfig /etc/rc.d/init.d/ypbind
> Is this just rpmlint problem or should I change %post and %preun
> sections somehow?
>
> %post and %preun sections in spec file:
>
> %post
> /bin/systemctl enable %{name}.service || :
>
> %preun
> if [ $1 -eq 0 ] ; then
> ┬* ┬* /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
> ┬* ┬* /bin/systemctl disable %{name}.service >/dev/null 2>&1 || :
> fi
>
>
> 2) there is some code before and after starting the daemon in former
> SysV init script, which should be executed even when using systemd unit
> file. I created two scripts, placed them to /usr/lib/ypbind/ and add
> them to "ExecStartPre:" in ypbind.service file. Is this correct solution
> or there is a better one to execute more complicated scripts
> before/after daemon script itself?

This is the most correct solution

>
> Regards,
>
> Honza
> --
> devel mailing list
> devel@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
>



--
Best regards,
Michal

http://eventhorizon.pl/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 06:59 PM
Lennart Poettering
 
Default Systemd unit file implementation questions (ypbind)

On Wed, 13.04.11 19:55, Honza Horak (hhorak@redhat.com) wrote:

> Hi,
>
> I'm working on systemd unit file for ypbind and found some problems,
> that I'm not sure about:
>
> 1) if I use systemctl enable/disable instead of chkconfig in %post and
> %preun sections in spec file, rpmlint prints errors:
> postin-without-chkconfig /etc/rc.d/init.d/ypbind
> preun-without-chkconfig /etc/rc.d/init.d/ypbind
> Is this just rpmlint problem or should I change %post and %preun
> sections somehow?

Yes, this looks like something that needs to be fixed in rpmlint eventually.

> 2) there is some code before and after starting the daemon in former
> SysV init script, which should be executed even when using systemd unit
> file. I created two scripts, placed them to /usr/lib/ypbind/ and add
> them to "ExecStartPre:" in ypbind.service file. Is this correct solution
> or there is a better one to execute more complicated scripts
> before/after daemon script itself?

In an ideal world the daemon binary itself does what is needed to start
up. In the real world ExecStartPre= is indeed what you should be using,
if your daemon isn't ideal (yet).

Lennart

--
Lennart Poettering - Red Hat, Inc.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 07:09 PM
Toshio Kuratomi
 
Default Systemd unit file implementation questions (ypbind)

On Wed, Apr 13, 2011 at 08:00:33PM +0200, Michał Piotrowski wrote:
> Hi,
>
> 2011/4/13 Honza Horak <hhorak@redhat.com>:
> > Hi,
> >
> > I'm working on systemd unit file for ypbind and found some problems,
> > that I'm not sure about:
> >
> > 1) if I use systemctl enable/disable instead of chkconfig in %post and
> > %preun sections in spec file, rpmlint prints errors:
> > postin-without-chkconfig /etc/rc.d/init.d/ypbind
> > preun-without-chkconfig /etc/rc.d/init.d/ypbind
> > Is this just rpmlint problem or should I change %post and %preun
> > sections somehow?
> >
> > %post and %preun sections in spec file:
> >
> > %post
> > /bin/systemctl enable %{name}.service || :
> >
> > %preun
> > if [ $1 -eq 0 ] ; then
> > ┬* ┬* /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
> > ┬* ┬* /bin/systemctl disable %{name}.service >/dev/null 2>&1 || :
> > fi
> >
Sounds like you have the /etc/rc.d/init.d/ypbind file in the same package as
the systemd service file. Change that and this will likely go away.

-Toshio
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 07:31 PM
"Jˇhann B. Gu­mundsson"
 
Default Systemd unit file implementation questions (ypbind)

On 04/13/2011 05:55 PM, Honza Horak wrote:
> Hi,
>
> I'm working on systemd unit file for ypbind and found some problems,
> that I'm not sure about:

It would be good if maintainers could take their time and assign
themselves to their components here [1] if they have the time to convert
old sysv to a native systemd native one so those of us that are helping
out and converting old sysv can better focus our efforts on those
maintainers that dont have that time.

It also would be good if maintainers that have received native systemd
service files would package and push them into rawhide as soon as possible.

Thanks

JBG

1.http://fedoraproject.org/wiki/User:Johannbg/QA/Systemd/compatability
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 08:55 PM
Miloslav Trma─Ź
 
Default Systemd unit file implementation questions (ypbind)

2011/4/13 "J├│hann B. Gu├░mundsson" <johannbg@gmail.com>:
> It would be good if maintainers could take their time and assign
> themselves to their components here [1] if they have the time to convert
> old sysv to a native systemd native one so those of us that are helping
> out and converting old sysv can better focus our efforts on those
> maintainers that dont have that time.
>
> It also would be good if maintainers that have received native systemd
> service files would package and push them into rawhide as soon as possible.

"It would be good if" the packaging guidelines were finalized first.
Mirek
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 09:00 PM
Lennart Poettering
 
Default Systemd unit file implementation questions (ypbind)

On Wed, 13.04.11 22:55, Miloslav Trma─Ź (mitr@volny.cz) wrote:

>
> 2011/4/13 "J├│hann B. Gu├░mundsson" <johannbg@gmail.com>:
> > It would be good if maintainers could take their time and assign
> > themselves to their components here [1] if they have the time to convert
> > old sysv to a native systemd native one so those of us that are helping
> > out and converting old sysv can better focus our efforts on those
> > maintainers that dont have that time.
> >
> > It also would be good if maintainers that have received native systemd
> > service files would package and push them into rawhide as soon as possible.
>
> "It would be good if" the packaging guidelines were finalized first.

The basic guidelines for packaging of systemd services have been
approved by the FPC.

Lennart

--
Lennart Poettering - Red Hat, Inc.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 09:17 PM
Toshio Kuratomi
 
Default Systemd unit file implementation questions (ypbind)

On Wed, Apr 13, 2011 at 11:00:18PM +0200, Lennart Poettering wrote:
> On Wed, 13.04.11 22:55, Miloslav Trma─Ź (mitr@volny.cz) wrote:
>
> >
> > 2011/4/13 "J├│hann B. Gu├░mundsson" <johannbg@gmail.com>:
> > > It would be good if maintainers could take their time and assign
> > > themselves to their components here [1] if they have the time to convert
> > > old sysv to a native systemd native one so those of us that are helping
> > > out and converting old sysv can better focus our efforts on those
> > > maintainers that dont have that time.
> > >
> > > It also would be good if maintainers that have received native systemd
> > > service files would package and push them into rawhide as soon as possible.
> >
> > "It would be good if" the packaging guidelines were finalized first.
>
> The basic guidelines for packaging of systemd services have been
> approved by the FPC.
>
But very explicitly, not the guidelines for converting a service from sysv
to systemd.

-Toshio
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-13-2011, 11:33 PM
Toshio Kuratomi
 
Default Systemd unit file implementation questions (ypbind)

On Wed, Apr 13, 2011 at 09:41:58PM +0000, "J├│hann B. Gu├░mundsson" wrote:
> On 04/13/2011 09:17 PM, Toshio Kuratomi wrote:
> > On Wed, Apr 13, 2011 at 11:00:18PM +0200, Lennart Poettering wrote:
> >> On Wed, 13.04.11 22:55, Miloslav Trma─Ź (mitr@volny.cz) wrote:
> >>
> >>> 2011/4/13 "J├│hann B. Gu├░mundsson"<johannbg@gmail.com>:
> >>>> It would be good if maintainers could take their time and assign
> >>>> themselves to their components here [1] if they have the time to convert
> >>>> old sysv to a native systemd native one so those of us that are helping
> >>>> out and converting old sysv can better focus our efforts on those
> >>>> maintainers that dont have that time.
> >>>>
> >>>> It also would be good if maintainers that have received native systemd
> >>>> service files would package and push them into rawhide as soon as possible.
> >>> "It would be good if" the packaging guidelines were finalized first.
> >> The basic guidelines for packaging of systemd services have been
> >> approved by the FPC.
> >>
> > But very explicitly, not the guidelines for converting a service from sysv
> > to systemd.
>
> Is this something that we that are converting the sysv init file to a
> native systemd one have to follow?
>
If asked, I would say yes. However, read my comment at the end.

> Is there a draft for that guidline somewhere?
>
Yep.

https://fedoraproject.org/wiki/User:Toshio/Systemd_scriptlet_options

> Note I was refering to rawhide and as soon as possible.
>
> With my QA hat on it's arguably to late in the F15 release cycle to
> introduce any native systemd service file at this point.
>
It's possible that any conversions done before the guidelines have been
finalized would have to be redone (or even reverted) as they haven't been
tested yet and there could be cornercases that will rquire them to be
updated (there's definitely been cornercases encountered before we got the
current form). However, for rawhide, I don't think that we'll hit the worst
case (reversion) -- there's just the chance that we'd have to find every
package that's doing an upgrade from sysv to systemd and change what it's
doing to match the final form. From the problems that have shown themselves
with past versions of these scriptlets, the bugs that we're likely to
encounter will won't leave us the luxury of grandfathering packages that are
using prior versions of the scriptlets -- we'll likely have to make any
package using old versions of the scriptlets change to using a new, fixed
version.

With that in mind, I think that selective updating in rawhide could be
helpful to finalizing the guidelines. Just be sure to be on the lookout for
corner cases, if you find something wrong, vaguely not the way you think it
should be, etc, report it to the FPC with as close to what you did to make
the problem reproducible, and finally, be sure to keep track of what
packages you've converted as they may need to be updated to use the latest
version of the scriptlets.

-Toshio
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-14-2011, 09:14 AM
Michal Hlavinka
 
Default Systemd unit file implementation questions (ypbind)

Hi,

I have similar question (sorry for stealing this thread). I have package
that has 3 services (they somehow depend on each other). Based on
configuration in /etc/sysconfig/.. file it starts 2 or 3 services. This is
handled by init script, but I don't know how to do it in systemd service
file.
AFAIK:
a)
EnvironmentFile=...
ExecStart=[ -n "$DRIVER" ] && /start/driver/...
ExecStart=[ -n "$BACKEND" ] && /start/backend/...
ExecStart=[ -n "$MONITOR" ] && /start/monitor/...

won't work, because ExecStart must be path, not shell command

b)
ExecStart=/usr/libexec/%{name}/startifset "$DRIVER" /start/driver
ExecStart=/usr/libexec/%{name}/startifset "$BACKEND" /start/backend
ExecStart=/usr/libexec/%{name}/startifset "$MONITOR" /start/monitor

won't work, because there ExecStart can't be used more than once,
except with type=oneshot, which does not work here

c)
ExecStart=/usr/libexec/nut/startthemall

this is only workable solution I know (for now), but I don't know if it's the best one

d) split it to more service files and make dependency there

this would be incompatible change in configuration and hard to do, because
dependency can change with configuration


Is there a good solution for this?

Michal



--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 08:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ę2007 - 2008, www.linux-archive.org