Hi Michal,<br><br>first, I know understand where our &quot;disagreement&quot; 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&#39;s initscript, and is called from halt.<br>
whereas, in RH/Fedora, you don&#39;t have this generic role (afaik), nor the hook in the package&#39;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&#39;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&#39;m anyway releasing the below draft answers, which clarifies a few points, and may serve anyway.<br>
<br>@Stan: I&#39;d like to hear your point of view here.<br><br><div class="gmail_quote">2011/4/26 Michal Hlavinka <span dir="ltr">&lt;<a href="mailto:mhlavink@redhat.com" target="_blank">mhlavink@redhat.com</a>&gt;</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>&gt; you&#39;ve completely missed my invitation to talk about packaging<br>
&gt; standardization:<br>
&gt; was it intentional?<br>
<br>
</div>nope. AFAIK packaging is already standardized on all distributions,</blockquote><div><br>I don&#39;t think we&#39;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 &quot;packaging is already standardized on all distributions&quot;!<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>
&gt; &gt; &gt; &gt;  That way, slower shell scripts<br>
&gt; &gt; &gt; &gt;&gt;&gt; only execute once when the system administrator changes the<br>
&gt; &gt; &gt; &gt;&gt;&gt; configuration, and systemd would read those generated files.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Still the same question, what do you want/need that script for?<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Maybe it&#39;s just a convenience that we don&#39;t really need. Arnaud?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I can&#39;t say it&#39;s a convenience, at least not more or less than the files<br>
&gt; &gt; it<br>
&gt; &gt; &gt; tries to replace.<br>
&gt; &gt; &gt; whatever the number of init script / service files, we need to instruct<br>
&gt; &gt; the<br>
&gt; &gt; &gt; system which NUT components it has to start.<br>
&gt; &gt; &gt; And having a way to do it the same across systems is worth IMHO.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; that being said, the shell approach doesn&#39;t satisfy me much, but was a<br>
&gt; &gt; good<br>
&gt; &gt; &gt; compromise for a first round.<br>
&gt; &gt; &gt; part of the work around the configuration, we might consider a config<br>
&gt; &gt; &gt; accessor, like:<br>
&gt; &gt; &gt; $ nut-config --get-mode<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; @Michal: would that suit systemd way of life?<br>
&gt; &gt;<br>
&gt; &gt; I probably don&#39;t understand what is it supposed to help with?<br>
&gt;<br>
&gt;<br>
&gt; - standardisation: one way (ie root source of setting, not way to obtain the<br>
&gt; 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&#39;s<br>
quite easy to configure nut when that task is similar to configuring smartd,<br>
httpd,... I don&#39;t think systemd &amp; nut is going to scare users when they<br>
already understand systemd thanks experience with httpd,dovecot,<br>
smartd,....  So I think it&#39;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&#39;d appreciate more when it&#39;s done the same way as all other sw on my system<br>
then when it&#39;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&#39;t think nut&amp;systemd configuration must<br>
be the same as nut&amp;SysV or nut&amp;upstart, it just seems that systemd is<br>
going to be adopted by other distributions (definitely not by all of them),<br>
so I&#39;d like to standardize nut&amp;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 &quot;external&quot; settings).<br>systemd seems to have a more simple approach, that doesn&#39;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>

&gt; - simplicity: you set one &quot;var&quot;, 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 &quot;groups&quot;<br>
A=upsdrvctl&amp;upsd  and B=upsmon<br></blockquote><div> <br>indeed. which doesn&#39;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>

&gt; just remember that, part of the roadmap, there is a configuration tools<br>
&gt; planned. and the above &quot;nut-config&quot; is the CLI side.<br>
&gt; having to manage bagazillion of different package names, binaries paths,<br>
&gt; user names, init config, (...) has refrained such efforts until now.<br>
&gt;<br>
&gt; many other effort would greatly benefit from an overall standardization of<br>
&gt; NUT distribution!<br>
&gt;<br>
&gt; If we use<br>
&gt; &gt; shell script &quot;one for all&quot; starting everything needed (based on MODE in<br>
&gt; &gt; nut.conf),<br>
&gt; &gt; it&#39;d be equal to option 3) from first email. Getting required mode from<br>
&gt; &gt; nut-config<br>
&gt; &gt; compared to getting it from nut.conf is no better from systemd&#39;s POV.<br>
&gt; &gt; Option<br>
&gt; &gt; &quot;3)&quot; is not prefered compared to option 4), but there&#39;s no enforcement<br>
&gt; &gt; policy<br>
&gt; &gt; about this. So, they won&#39;t like us, but we can ignore their grumbling :o)<br>
&gt; &gt; btw, systemd supports:<br>
&gt; &gt; EnvironmentFile=/some/config/file (containing ABC=foo)<br>
&gt; &gt; ExecStart=/sbin/daemon -abc $ABC<br>
&gt; &gt;<br>
&gt; &gt; but it does not support /some/config/file containing ABC=$(get-config<br>
&gt; &gt; --abc)<br>
&gt; &gt; nor ExecStart=/sbin/daemon -abc $(get-config --abc)<br>
&gt; &gt;<br>
&gt;<br>
&gt; do not confuse splitting services into separate files (we are all ok with<br>
&gt; option 4)<br>
&gt; and triggering or conditioning service startup.<br>
&gt;<br>
&gt; the former can be linked to package splitting, ie upsmon is part of<br>
&gt; nut-client along with its service file.<br>
&gt; while drivers/upsd are part of the core.<br>
&gt;<br>
&gt; the latter is related to nut.conf and... well, I still fail to see how<br>
&gt; systemd provides this.<br>
&gt; you&#39;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&#39;s configuration or should it<br>
ignore MODE= ? Whatever way it would be, it&#39;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&#39;s not expected that user changes his init systemd<br>
as simple update process, but only on system upgrade OR it&#39;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 &quot;poweroff&quot; target of the NUT sysV init script?<br><br>      if upsmon -K &gt;/dev/null 2&gt;&amp;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>
&gt;<br>
&gt; &gt; a side question: what is the status of Augeas (still RH sponsored project)<br>
&gt; &gt; &gt; in Fedora / RedHat?<br>
&gt; &gt;<br>
&gt; &gt; It&#39;s installable on Fedora and it&#39;s still actively developed, but I don&#39;t<br>
&gt; &gt; know about<br>
&gt; &gt; anything using it.<br>
&gt; &gt;<br>
&gt;<br>
&gt; mcollective seems to be a first step toward something useful.<br>
&gt; I&#39;m astonished that RH guys have not started converting system-config-* to<br>
&gt; augeas, nor developed infrastructure tools!<br>
&gt; 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&#39;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&amp;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>