Hi Michal,<br><br>first, I know understand where our "disagreement" comes from:<br>in Debian, we have a generic ups-monitor role provided by several packages.<br>the shutoff (final ups poweroff) hook is located in the package's initscript, and is called from halt.<br>
whereas, in RH/Fedora, you don't have this generic role (afaik), nor the hook in the package's initscript.<br><br>which means that NUT initscript in RH only has to deal with start/stop/restart, which are the standard conditions.<br>
I'll have to think more about that, but for the time being, you may want to progress with your previously mentioned approach (4).<br><br>I'm anyway releasing the below draft answers, which clarifies a few points, and may serve anyway.<br>
<br>@Stan: I'd like to hear your point of view here.<br><br><div class="gmail_quote">2011/4/26 Michal Hlavinka <span dir="ltr"><<a href="mailto:mhlavink@redhat.com" target="_blank">mhlavink@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>> you've completely missed my invitation to talk about packaging<br>
> standardization:<br>
> was it intentional?<br>
<br>
</div>nope. AFAIK packaging is already standardized on all distributions,</blockquote><div><br>I don't think we're talking about the same things!<br><br>Here are the packages on Suse (@Stan: nothing missing?)<br>
- nut (provided by either nut-classic or nut-hal iirc)<br>- nut-cgi<br>- nut-classic<br>- nut-devel<br>- nut-drivers-net<br>- nut-hal<br>- libupsclient1<br><br>On RH/Fedora:<br>- nut<br>- nut-cgi<br>- nut-client<br>- nut-devel<br>
- nut-hal<br>- nut-xml<br><br>Here are the one on Debian and its derivatives:<br>- nut<br>- nut-cgi<br>- nut-hal-drivers<br>- nut-powerman-pdu<br>- nut-snmp<br>- nut-xml<br>- libupsclient1<br>- libupsclient1-dev<br><br>On Debian, several new packages will appears:<br>
- nut-doc (+ nut-doc-html and nut-doc-pdf)<br>- nut-client (for moving upsmon and base clients)<br><br>Things like libupsclient has been extracted from the nut package to satisfy 3rd party tools, like collectd, nut-cgi and wmnut in case there is no local NUT for example.<br>
Moreover, things like the SNMP agent resurrection, discovery and configuration tools, integrated power management (feed upower), (...) may impact the way NUT is packaged.<br><br>So, we can say that there are similarities.<br>
But certainly not that "packaging is already standardized on all distributions"!<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
so only<br>
new changes needs to be standardized and that is exactly why I sent<br>
this email instead of just doing it Fedora way in Fedora.<br></blockquote><div><br>thanks for that, this is very much appreciated, Michal.<br>lowering the barrier between upstream and downstream (ie distros) has been part of my todo list for an eternity.<br>
so packagers help and discussion are always welcome.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
> > > > That way, slower shell scripts<br>
> > > >>> only execute once when the system administrator changes the<br>
> > > >>> configuration, and systemd would read those generated files.<br>
> > > >>><br>
> > > >><br>
> > > >> Still the same question, what do you want/need that script for?<br>
> > > >><br>
> > > ><br>
> > > > Maybe it's just a convenience that we don't really need. Arnaud?<br>
> > > ><br>
> > ><br>
> > > I can't say it's a convenience, at least not more or less than the files<br>
> > it<br>
> > > tries to replace.<br>
> > > whatever the number of init script / service files, we need to instruct<br>
> > the<br>
> > > system which NUT components it has to start.<br>
> > > And having a way to do it the same across systems is worth IMHO.<br>
> > ><br>
> > > that being said, the shell approach doesn't satisfy me much, but was a<br>
> > good<br>
> > > compromise for a first round.<br>
> > > part of the work around the configuration, we might consider a config<br>
> > > accessor, like:<br>
> > > $ nut-config --get-mode<br>
> > ><br>
> > > @Michal: would that suit systemd way of life?<br>
> ><br>
> > I probably don't understand what is it supposed to help with?<br>
><br>
><br>
> - standardisation: one way (ie root source of setting, not way to obtain the<br>
> setting) for all systems, whatever distro, whatever init<br>
<br>
</div>well in distro A all services are configured the same way, so I think it's<br>
quite easy to configure nut when that task is similar to configuring smartd,<br>
httpd,... I don't think systemd & nut is going to scare users when they<br>
already understand systemd thanks experience with httpd,dovecot,<br>
smartd,.... So I think it's questionable whether to do everything the same<br>
way for one package on all systems OR handle package the same way as all<br>
other packages on system XYZ. If I have experience with Fedora/Debian/<br>
OpenSUSE/Mandriva/... and I want to find out how to set up nut on my system,<br>
I'd appreciate more when it's done the same way as all other sw on my system<br>
then when it's done the same way on all systems. So I think standardization<br>
is good (where I can find config file X, documentation,....), but I find init<br>
system little bit different. I don't think nut&systemd configuration must<br>
be the same as nut&SysV or nut&upstart, it just seems that systemd is<br>
going to be adopted by other distributions (definitely not by all of them),<br>
so I'd like to standardize nut&systemd the way which does not need to be<br>
100 % compatible with SysV init system (at least from my POV).<br></blockquote><div><br>AFAICT, sysV init and upstart can work with MODE (and "external" settings).<br>systemd seems to have a more simple approach, that doesn't allow condition, nor external settings, nor any other hook than start/stop/restart.<br>
do you know if there any plan for such non standard actions/hooks for systemd?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
> - simplicity: you set one "var", instead of 2 in you system.<br>
<br>
</div>afaik for upsdrvctl, upsd and upsmon the first two should work together<br>
always and the third one is independent. So there are two "groups"<br>
A=upsdrvctl&upsd and B=upsmon<br></blockquote><div> <br>indeed. which doesn't implies to have 2 configuration files.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
change from:<br>
chkconfig ups on<br>
to<br>
systemctl enable ups.service<br>
or<br>
systemctl enable ups.service; systemctl enable upsmon.service<br>
<br>
does not make that big difference and I think this behavior is<br>
expected (at least in Fedora/RHEL).<br></blockquote><div><br>just ask yourself the question:<br>do users want to know that they need to start upsdrvctl / upsd / upsmon?<br>and the way they have to do it on every different system they might have.<br>
or do they want to select a use case that matches their needs, like:<br>- [manual and none] special cases,<br>
- standalone setup<br>- network server (master),<br>- network client (slave),<br>- pm (power management ; only implies driver(s) in pm-mode, feeding upower, + upsd)<br>
- supervision (only implies driver(s) + upsd)<br><br>Note that the 2 latter were missing, and the last is the one that answers your question on not starting upsmon.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div>
> just remember that, part of the roadmap, there is a configuration tools<br>
> planned. and the above "nut-config" is the CLI side.<br>
> having to manage bagazillion of different package names, binaries paths,<br>
> user names, init config, (...) has refrained such efforts until now.<br>
><br>
> many other effort would greatly benefit from an overall standardization of<br>
> NUT distribution!<br>
><br>
> If we use<br>
> > shell script "one for all" starting everything needed (based on MODE in<br>
> > nut.conf),<br>
> > it'd be equal to option 3) from first email. Getting required mode from<br>
> > nut-config<br>
> > compared to getting it from nut.conf is no better from systemd's POV.<br>
> > Option<br>
> > "3)" is not prefered compared to option 4), but there's no enforcement<br>
> > policy<br>
> > about this. So, they won't like us, but we can ignore their grumbling :o)<br>
> > btw, systemd supports:<br>
> > EnvironmentFile=/some/config/file (containing ABC=foo)<br>
> > ExecStart=/sbin/daemon -abc $ABC<br>
> ><br>
> > but it does not support /some/config/file containing ABC=$(get-config<br>
> > --abc)<br>
> > nor ExecStart=/sbin/daemon -abc $(get-config --abc)<br>
> ><br>
><br>
> do not confuse splitting services into separate files (we are all ok with<br>
> option 4)<br>
> and triggering or conditioning service startup.<br>
><br>
> the former can be linked to package splitting, ie upsmon is part of<br>
> nut-client along with its service file.<br>
> while drivers/upsd are part of the core.<br>
><br>
> the latter is related to nut.conf and... well, I still fail to see how<br>
> systemd provides this.<br>
> you've mentioned /etc/sysconfig/ups removal, but no replacement mechanism!<br>
<br>
</div></div>MODE can give only 4 possibilities (afaik)<br>
A on | on | off | off<br>
B on | off | on | off<br>
<br>
A=upsd+upsdrvctl<br>
B=upsmon<br>
<br>
and this can be achieved very easily with just two standard configuration<br>
commands and thanks splitting nut to 2(3) service files they will work just<br>
out of the box. I can (will) add simple scriptlet in rpm %post so services are<br>
configured (on/off) initialy when upgrading from sysv version with<br>
etc/sysconfig/ups to systemd version.<br>
<br>
Anyway, when 2 services and MODE in etc/sysconfig/ups kept, what should<br>
happen, when:<br>
MODE=A+B, A is running, B stopped and user restarts A?<br>
MODE=A, A+B is running, user restarts A?<br>
...<br>
basically should it stop running service? restart only running? start<br>
missing? Or simply should it ignore systemd's configuration or should it<br>
ignore MODE= ? Whatever way it would be, it'd require some ugly hacks<br>
and script wrapper around executables or auto modification of service<br>
files (what if user changed anything in service file, should we touch<br>
that file and break his configuration or ignore MODE=?). It seems to me<br>
doing it the same way as other services on specific system/distribution<br>
to be better way than trying to have systemd compatible with<br>
sysv/upstart. Anyway, it's not expected that user changes his init systemd<br>
as simple update process, but only on system upgrade OR it'll require some<br>
manual changes.<br></blockquote><div><br>well, were talking about an exception case here.<br>services registration / activation is a point.<br>what we are talking about, once more, is what is done inside of these scripts.<br>
<br>As an obvious (and probably the most basic) example with NUT:<br>how will you handle the "poweroff" target of the NUT sysV init script?<br><br> if upsmon -K >/dev/null 2>&1 ; then<br> if upsdrvctl shutdown ; then<br>
<br>(Note: this is where I stopped and understand our issue, as explained as an introduction to this mail...)<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
><br>
> > a side question: what is the status of Augeas (still RH sponsored project)<br>
> > > in Fedora / RedHat?<br>
> ><br>
> > It's installable on Fedora and it's still actively developed, but I don't<br>
> > know about<br>
> > anything using it.<br>
> ><br>
><br>
> mcollective seems to be a first step toward something useful.<br>
> I'm astonished that RH guys have not started converting system-config-* to<br>
> augeas, nor developed infrastructure tools!<br>
> or did I miss something?<br>
<br>
</div><a href="http://fedoraproject.org/wiki/Features/FMCI" target="_blank">http://fedoraproject.org/wiki/Features/FMCI</a> (Ignore target release=Fedora 15,<br>
it's not valid.) This project is combined with (extension to) matahari<br>
( <a href="https://fedorahosted.org/matahari/" target="_blank">https://fedorahosted.org/matahari/</a> ). Current status is that they are<br>
working to finish backend (dbus and cli) which should be completed for Fedora<br>
16. Work on gui should start after that.<br>
</blockquote></div><br>interesting, thanks for the pointers.<br><br>cheers,<br clear="all">Arnaud<br>-- <br>Linux / Unix Expert R&D - Eaton - <a href="http://powerquality.eaton.com" target="_blank">http://powerquality.eaton.com</a><br>
Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/" target="_blank">http://www.networkupstools.org/</a><br>Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>
Free Software Developer - <a href="http://arnaud.quette.free.fr/" target="_blank">http://arnaud.quette.free.fr/</a><br><br>