:: Re: [DNG] [DN Offlist G] netman GIT…
Góra strony
Delete this message
Reply to this message
Autor: tilt!
Data:  
Dla: Edward Bartolo, aitor_czr, Steve Litt
CC: dng
Temat: Re: [DNG] [DN Offlist G] netman GIT project
Hi,

On 09/13/2015 08:10 PM, Edward Bartolo wrote:
> I think, the time has come to start thinking about producing a .deb
> package for netman. However, we will have to use a post installation
> script to add the line:
>
> "iface wlan0 inet dhcp"
>
> to /etc/network/interfaces.


Is that really neccessary? How about people who install the package
but have no wlan0 or have a hot-pluggable WiFi interface or ...
Won't they get errors from that then?

> The script has also to create a new
> directory under /usr/bin with the name netman ie /usr/bin/netman will
> hold both the frontend and the backend.


Please allow me to instead recommend exectuable files named

"/usr/bin/netman" for the frontend and
"/usr/lib/netman/bin/backend" for the backend.

Reasons:

* Subdirectories of /usr/bin are undesireable, because they will
confuse programs that rely on PATH to only contain directories
that only contain executables.

* It is good practise to name the main application executable
the same as the package. Therefore, if the package is called
"netman", the main application should also be called "netman".
This will leave unprepared users with an improved experience.

The backend executable is not really intended for manual invokation.
It therefore should not reside in PATH. I understand it to be an
"internal binary" which FHS 2.3 section 4 mandates should reside in
/usr/lib/<application> (see [FHS]).

> The SUID for backend must be changed to that belonging to root. I do
> this as follows:
> chown root:root backend
> chmod u+s backend


No problem, can do that in "debian/netman.postinst".

> A new directory under /etc/network with the name wifi must be created
> i.e. /etc/network/wifi must be an existing directory.


No problem, can do that in "debian/netman.postinst".

> Then, the final steps would be to create a launcher for netman, the
> frontend.


Add file "netman.desktop" to system-wide autostart-folder:

* Write a file "netman.desktop" as described in [DESKTOP].
* Let the postinst script copy it to "/etc/xdg/autostart".

Add "Debian Menu Entry":

* Create a file debian/netman.menu as described in [DMENU].
* Let debhelper do the rest.

As a result, XDG compliant desktop environments will autostart
the GUI and all Debian-menu-aware window managers will have an
entry for the GUI in the "Debian" menu.

> To enable automatic attempts at connecting basing on installed essid
> files under /etc/network/wifi, the parameter --auto-conn must be
> passed to netman upon invocation. --auto-conn need not be used and
> netman would not attempt to connect without user intervention. This
> feature is for those who want to control what happens on their
> machine.


The decision if the package should provide the launchers described
above is indeed difficult.

In my opinion, the optimum would be if, in the running GUI,
a possibility to change the autoconnecting behavior on a permanent
basis existed, so that, when "netman" is started the next time,
auto-connecting would be turned off or on according to the last
decision the user made. The default setting would be much less
important then.

Kind regards,
T.

Links:

[FHS]: Filesystem Hierarchy Standard, Version 2.3.
Section 4. Subsection "/usr/lib : Libraries for programming
and packages". Subsubsection "Purpose".
URL: http://www.pathname.com/fhs/pub/fhs-2.3.html#PURPOSE22

[DESKTOP] freedesktop.org. Desktop Entry Specification.
Appendix A: Example Desktop Entry File.
URL: http://standards.freedesktop.org/desktop-entry-spec/latest/apa.html

[DMENU]: Debian Menu System. Chapter 3 - The menu file
URL: https://www.debian.org/doc/packaging-manuals/menu.html/ch3.html