Subtle difference in behavior of installation packages
Subtle difference in behavior of installation packages
Re: Subtle difference in behavior of installation packages
2012-02-08 18:21 UTC
Hi,
On Wednesday 08 February 2012 13:10:25 John Pietrzak wrote:
> Hi folks,
>
> I've been working on a small Maemo app, and have reached the point where
> I've pushed it up to Extras-Devel. Almost everything works perfectly,
> except for one item: I've created a sudoers file for the app, in order
> to allow it to call "modprobe" to load a kernel module. (This is the
> "lirc_rx51" module, needed for access to the IR hardware.) This file
> needs to go into the /etc/sudoers.d directory.
>
> I can install and uninstall the file just fine using the debian package
> I've constructed locally. When installing the app from the Extras-Devel
> repository, however, the application manager can place the file into
> /etc/sudoers.d, but seems unable to remove it when uninstalling.
Try to run apt-get remove <package> in xterm. This is what application manager
doing... Also see error in application manager log.
>
> I'm using the Qt SDK, and have recently upgraded to Qt Creator 2.4.1, so
> maybe the latest Qt software creates debian packages differently than
> the Extras system does...
>
> So, I guess these are my questions:
>
> 1) Do I need to do something special to install/uninstall files to the
> /etc directory in Maemo?
I think nothing special. Only add your /etc files to conffiles in debian
package, but this is done by debhelper script for dpkg-buildpackage. So really
nothing.
>
> 2) Should I even be using /etc/sudoers.d to let my app access modprobe?
> What is the preferred way for an app to make requests of the kernel?
Yes add sudoers file, run script for updating sudoers.d and use:
sudo modprobe <module>
>
> Thanks!
>
> --John
--
Pali Rohár
pali.rohar@gmail.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAk8yvRwACgkQi/DJPQPkQ1LqowCgie736usS5EpK7K4zQw9xlGO9
5FIAn2iXSV2i/1fSbmUjfhrol6ckOT6a
=oKkA
-----END PGP SIGNATURE-----
On Wednesday 08 February 2012 13:10:25 John Pietrzak wrote:
> Hi folks,
>
> I've been working on a small Maemo app, and have reached the point where
> I've pushed it up to Extras-Devel. Almost everything works perfectly,
> except for one item: I've created a sudoers file for the app, in order
> to allow it to call "modprobe" to load a kernel module. (This is the
> "lirc_rx51" module, needed for access to the IR hardware.) This file
> needs to go into the /etc/sudoers.d directory.
>
> I can install and uninstall the file just fine using the debian package
> I've constructed locally. When installing the app from the Extras-Devel
> repository, however, the application manager can place the file into
> /etc/sudoers.d, but seems unable to remove it when uninstalling.
Try to run apt-get remove <package> in xterm. This is what application manager
doing... Also see error in application manager log.
>
> I'm using the Qt SDK, and have recently upgraded to Qt Creator 2.4.1, so
> maybe the latest Qt software creates debian packages differently than
> the Extras system does...
>
> So, I guess these are my questions:
>
> 1) Do I need to do something special to install/uninstall files to the
> /etc directory in Maemo?
I think nothing special. Only add your /etc files to conffiles in debian
package, but this is done by debhelper script for dpkg-buildpackage. So really
nothing.
>
> 2) Should I even be using /etc/sudoers.d to let my app access modprobe?
> What is the preferred way for an app to make requests of the kernel?
Yes add sudoers file, run script for updating sudoers.d and use:
sudo modprobe <module>
>
> Thanks!
>
> --John
--
Pali Rohár
pali.rohar@gmail.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAk8yvRwACgkQi/DJPQPkQ1LqowCgie736usS5EpK7K4zQw9xlGO9
5FIAn2iXSV2i/1fSbmUjfhrol6ckOT6a
=oKkA
-----END PGP SIGNATURE-----
Re: Subtle difference in behavior of installation packages
2012-02-08 20:04 UTC
On Wed, 08 Feb 2012 19:21:16 +0100, Pali Rohár wrote:
> > I can install and uninstall the file just fine using the debian package
> > I've constructed locally. When installing the app from the Extras-Devel
> > repository, however, the application manager can place the file into
> > /etc/sudoers.d, but seems unable to remove it when uninstalling.
> Try to run apt-get remove <package> in xterm. This is what application manager
> doing... Also see error in application manager log.
apt-get remove without --purge won't remove conffiles, which would
explain why /etc/sudoers.d/foo is still there ...
And that's on purpose at least in Debian. If HAM can't be told to
purge a package there's not much that can be done (short of using
brute force in the postrm maintainer script. Ehh, this sounds ugly.).
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
: :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Carole King: Will You Still Love Me Tomorrow
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBCAAGBQJPMtVGAAoJELs6aAGGSaoGnSEP/iA+ThcVrX9F56t3WRD2jY9h
mGP170zdIw2h6H11ADbk1gO6GX1NNev9l7DXmNyrQHAIUpd7BMvZzACnJ96da2jK
REMF6bey5dinivJl9z1mMj5bE6vvAtTf+dxYzdpfpTX4RrKcQsOqPZjCVhDzlDbM
Kf4Gn7iPmlKzOXAc3iVbiwrTkwCyPS3a3dkBeOKDuw14d4AUOTfFXS1wxC0M52y1
sprd+Xioy4xVqmi4suAT3n6kPgD/rTWE0CXDRf5GuRLi2a+yHzLS+4zWz+J9b7qV
DOf9hBYbcrLkNU8i4ZXsO9vJbOu/fAaDyw9iYmCB5q0o/K/dY193UWUjecI+LEDA
WZMOsaMw7DTcRIsV96fRPxTLLJyPlx428xtGI9umwGXusuthV8LDuZx+8duRNIlj
BIKffvWLl/ALqDjikh3q4W8Koc/8kMMOhffkD1/32SrewnAOclN8c0sP/kpoJLBf
QMH0UpuEjsO3JkGp9umqXhhGLagGEgSE2BpU8b2H7HEtsflpNBzk/yNdHJ/ZtTKL
e/NuwDglN4CqLVqA2XjXGn6BO/G3HRO5t2T5g58KWc0t0wFAYSS2fi3h5o+TZDMr
ZLm3Km8FdzMS4CtA/s9J3e1wB+xHAUeZL6G7EUbcTETW1fbz/cuvk9TVcWpfj38U
irwfwuv+m4Q+LsDEk7W8
=JvmZ
-----END PGP SIGNATURE-----
> > I can install and uninstall the file just fine using the debian package
> > I've constructed locally. When installing the app from the Extras-Devel
> > repository, however, the application manager can place the file into
> > /etc/sudoers.d, but seems unable to remove it when uninstalling.
> Try to run apt-get remove <package> in xterm. This is what application manager
> doing... Also see error in application manager log.
apt-get remove without --purge won't remove conffiles, which would
explain why /etc/sudoers.d/foo is still there ...
And that's on purpose at least in Debian. If HAM can't be told to
purge a package there's not much that can be done (short of using
brute force in the postrm maintainer script. Ehh, this sounds ugly.).
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
: :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Carole King: Will You Still Love Me Tomorrow
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBCAAGBQJPMtVGAAoJELs6aAGGSaoGnSEP/iA+ThcVrX9F56t3WRD2jY9h
mGP170zdIw2h6H11ADbk1gO6GX1NNev9l7DXmNyrQHAIUpd7BMvZzACnJ96da2jK
REMF6bey5dinivJl9z1mMj5bE6vvAtTf+dxYzdpfpTX4RrKcQsOqPZjCVhDzlDbM
Kf4Gn7iPmlKzOXAc3iVbiwrTkwCyPS3a3dkBeOKDuw14d4AUOTfFXS1wxC0M52y1
sprd+Xioy4xVqmi4suAT3n6kPgD/rTWE0CXDRf5GuRLi2a+yHzLS+4zWz+J9b7qV
DOf9hBYbcrLkNU8i4ZXsO9vJbOu/fAaDyw9iYmCB5q0o/K/dY193UWUjecI+LEDA
WZMOsaMw7DTcRIsV96fRPxTLLJyPlx428xtGI9umwGXusuthV8LDuZx+8duRNIlj
BIKffvWLl/ALqDjikh3q4W8Koc/8kMMOhffkD1/32SrewnAOclN8c0sP/kpoJLBf
QMH0UpuEjsO3JkGp9umqXhhGLagGEgSE2BpU8b2H7HEtsflpNBzk/yNdHJ/ZtTKL
e/NuwDglN4CqLVqA2XjXGn6BO/G3HRO5t2T5g58KWc0t0wFAYSS2fi3h5o+TZDMr
ZLm3Km8FdzMS4CtA/s9J3e1wB+xHAUeZL6G7EUbcTETW1fbz/cuvk9TVcWpfj38U
irwfwuv+m4Q+LsDEk7W8
=JvmZ
-----END PGP SIGNATURE-----
Re: Subtle difference in behavior of installation packages
2012-02-08 20:15 UTC
On Wednesday 08 February 2012 21:04:26 gregor herrmann wrote:
> On Wed, 08 Feb 2012 19:21:16 +0100, Pali Rohár wrote:
> > > I can install and uninstall the file just fine using the debian package
> > > I've constructed locally. When installing the app from the Extras-Devel
> > > repository, however, the application manager can place the file into
> > > /etc/sudoers.d, but seems unable to remove it when uninstalling.
> >
> > Try to run apt-get remove <package> in xterm. This is what application
> > manager doing... Also see error in application manager log.
>
> apt-get remove without --purge won't remove conffiles, which would
> explain why /etc/sudoers.d/foo is still there ...
>
> And that's on purpose at least in Debian. If HAM can't be told to
> purge a package there's not much that can be done (short of using
> brute force in the postrm maintainer script. Ehh, this sounds ugly.).
>
>
> Cheers,
> gregor
You can create sudoers.d file in postinst file and remove it in postrm.
echo "..." > /etc/sudoers.d/...
Or you can force debhelper to not add that sudoers file to conffiles.
--
Pali Rohár
pali.rohar@gmail.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAk8y19AACgkQi/DJPQPkQ1LF5wCgqP5iZtaYRL4zBF/Jp+PK5Kx4
lw8Anjm1TMmXZELRaVFv0Vw9Vn4feLEP
=At40
-----END PGP SIGNATURE-----
> On Wed, 08 Feb 2012 19:21:16 +0100, Pali Rohár wrote:
> > > I can install and uninstall the file just fine using the debian package
> > > I've constructed locally. When installing the app from the Extras-Devel
> > > repository, however, the application manager can place the file into
> > > /etc/sudoers.d, but seems unable to remove it when uninstalling.
> >
> > Try to run apt-get remove <package> in xterm. This is what application
> > manager doing... Also see error in application manager log.
>
> apt-get remove without --purge won't remove conffiles, which would
> explain why /etc/sudoers.d/foo is still there ...
>
> And that's on purpose at least in Debian. If HAM can't be told to
> purge a package there's not much that can be done (short of using
> brute force in the postrm maintainer script. Ehh, this sounds ugly.).
>
>
> Cheers,
> gregor
You can create sudoers.d file in postinst file and remove it in postrm.
echo "..." > /etc/sudoers.d/...
Or you can force debhelper to not add that sudoers file to conffiles.
--
Pali Rohár
pali.rohar@gmail.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAk8y19AACgkQi/DJPQPkQ1LF5wCgqP5iZtaYRL4zBF/Jp+PK5Kx4
lw8Anjm1TMmXZELRaVFv0Vw9Vn4feLEP
=At40
-----END PGP SIGNATURE-----
Re: Subtle difference in behavior of installation packages

John Pietrzak
On 2/8/12 3:15 PM, Pali Rohár wrote:
> On Wednesday 08 February 2012 21:04:26 gregor herrmann wrote:
>
>> apt-get remove without --purge won't remove conffiles, which would
>> explain why /etc/sudoers.d/foo is still there ...
>>
>> And that's on purpose at least in Debian. If HAM can't be told to
>> purge a package there's not much that can be done (short of using
>> brute force in the postrm maintainer script. Ehh, this sounds ugly.).
>>
Yes, I tried the brute-force approach, and it was ugly. Ended up with
the package manager thinking the sudoers file still existed. :(
BTW, what is Debian's purpose on keeping conffiles around? Is there
value in having config info for nonexisting packages? (Should I not be
worried about leaving sudoers files in the sudoers.d directory?)
> You can create sudoers.d file in postinst file and remove it in postrm.
> echo "..."> /etc/sudoers.d/...
Thanks, tried that out, and it works fine! I guess I'll just go with
that for now...
Thanks,
--John
> On Wednesday 08 February 2012 21:04:26 gregor herrmann wrote:
>
>> apt-get remove without --purge won't remove conffiles, which would
>> explain why /etc/sudoers.d/foo is still there ...
>>
>> And that's on purpose at least in Debian. If HAM can't be told to
>> purge a package there's not much that can be done (short of using
>> brute force in the postrm maintainer script. Ehh, this sounds ugly.).
>>
Yes, I tried the brute-force approach, and it was ugly. Ended up with
the package manager thinking the sudoers file still existed. :(
BTW, what is Debian's purpose on keeping conffiles around? Is there
value in having config info for nonexisting packages? (Should I not be
worried about leaving sudoers files in the sudoers.d directory?)
> You can create sudoers.d file in postinst file and remove it in postrm.
> echo "..."> /etc/sudoers.d/...
Thanks, tried that out, and it works fine! I guess I'll just go with
that for now...
Thanks,
--John
Re: Subtle difference in behavior of installation packages
2012-02-09 23:30 UTC
On Wed, 08 Feb 2012 18:38:53 -0500, John Pietrzak wrote:
> >>apt-get remove without --purge won't remove conffiles, which would
> >>explain why /etc/sudoers.d/foo is still there ...
> >>And that's on purpose at least in Debian.
> BTW, what is Debian's purpose on keeping conffiles around? Is there
> value in having config info for nonexisting packages? (Should I not
> be worried about leaving sudoers files in the sudoers.d directory?)
A package might be removed only temporarily or in error, and be
reinstalled again later. In that case the admin will be happy to find
their carefully tweaked config files instead of having to re-create
them from scratch (or grab them from a backup or an older git
revision).
And in general conffiles lying around in /etc/ don't hurt.
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
: :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Bruce Springsteen: The Promised Land
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBCAAGBQJPNFcRAAoJELs6aAGGSaoG9FcP/2YuEfmVlHczZ52Hj9M/wSvQ
bX4mhN7LZfNETGGQK4dXj+VOButowVwe5KV7A1PDpWBQetV1XPd22fiS9U2Krn2z
dhyRb3mE+d0Mkkr3/2XQS4+iablg+ej+u9lFPyxSPSCf32bk9QmtfOoajBtvftW5
68EtqRXZT3XNfC2Z3cNU778Ti66viKLniDBDM3lS7TVS/q5h6czxELMuv1RrDsVh
nXTjhv7ZddoEGDP/HCrL29BsFlQ3bCs389qUKl8PzluLNpboPPqspSRIOzGDNVQE
IVtYFjZSQegSVXzQIZGC5MbdxqvYQK2xaBoIsTQvZjvYO6RDg1mhNrQHMv+YA81E
YeV8cjc8jrYGD0jMAz5WVOkOdQJ6sZuqDeanDEumuj0T13C3czQYESK5EM5v2K1X
8zCr3MUJ8DDtH7olC6L2fkMENKvrN5+69NyFwLsyXXO6oKzXzA1vuYDP85p864+k
zszWETZKECan660sjrFJq10xLVbJeZ/B1pfBiIoZ5TOQIBHO6v5x8A6ZdHwRGZcs
qJtttqvD+jV+risSLYw88PU7TdzMHzrUm/QN5RUJ7bPxuRdBhmrtq8Mk6GvSDto1
zRVkyM3UvlxI0pWC6UzM1N7++nEGvKM6LyVCxJu/AmGnFE0HbEg3xdsVzroHtbdZ
5TzNTFqocD6cfkHozst+
=ude0
-----END PGP SIGNATURE-----
> >>apt-get remove without --purge won't remove conffiles, which would
> >>explain why /etc/sudoers.d/foo is still there ...
> >>And that's on purpose at least in Debian.
> BTW, what is Debian's purpose on keeping conffiles around? Is there
> value in having config info for nonexisting packages? (Should I not
> be worried about leaving sudoers files in the sudoers.d directory?)
A package might be removed only temporarily or in error, and be
reinstalled again later. In that case the admin will be happy to find
their carefully tweaked config files instead of having to re-create
them from scratch (or grab them from a backup or an older git
revision).
And in general conffiles lying around in /etc/ don't hurt.
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
: :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Bruce Springsteen: The Promised Land
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBCAAGBQJPNFcRAAoJELs6aAGGSaoG9FcP/2YuEfmVlHczZ52Hj9M/wSvQ
bX4mhN7LZfNETGGQK4dXj+VOButowVwe5KV7A1PDpWBQetV1XPd22fiS9U2Krn2z
dhyRb3mE+d0Mkkr3/2XQS4+iablg+ej+u9lFPyxSPSCf32bk9QmtfOoajBtvftW5
68EtqRXZT3XNfC2Z3cNU778Ti66viKLniDBDM3lS7TVS/q5h6czxELMuv1RrDsVh
nXTjhv7ZddoEGDP/HCrL29BsFlQ3bCs389qUKl8PzluLNpboPPqspSRIOzGDNVQE
IVtYFjZSQegSVXzQIZGC5MbdxqvYQK2xaBoIsTQvZjvYO6RDg1mhNrQHMv+YA81E
YeV8cjc8jrYGD0jMAz5WVOkOdQJ6sZuqDeanDEumuj0T13C3czQYESK5EM5v2K1X
8zCr3MUJ8DDtH7olC6L2fkMENKvrN5+69NyFwLsyXXO6oKzXzA1vuYDP85p864+k
zszWETZKECan660sjrFJq10xLVbJeZ/B1pfBiIoZ5TOQIBHO6v5x8A6ZdHwRGZcs
qJtttqvD+jV+risSLYw88PU7TdzMHzrUm/QN5RUJ7bPxuRdBhmrtq8Mk6GvSDto1
zRVkyM3UvlxI0pWC6UzM1N7++nEGvKM6LyVCxJu/AmGnFE0HbEg3xdsVzroHtbdZ
5TzNTFqocD6cfkHozst+
=ude0
-----END PGP SIGNATURE-----
Re: Subtle difference in behavior of installation packages

John Pietrzak
On 2/9/12 6:30 PM, gregor herrmann wrote:
> On Wed, 08 Feb 2012 18:38:53 -0500, John Pietrzak wrote:
>> BTW, what is Debian's purpose on keeping conffiles around? Is there
>> value in having config info for nonexisting packages? (Should I not
>> be worried about leaving sudoers files in the sudoers.d directory?)
> A package might be removed only temporarily or in error, and be
> reinstalled again later. In that case the admin will be happy to find
> their carefully tweaked config files instead of having to re-create
> them from scratch (or grab them from a backup or an older git
> revision).
> And in general conffiles lying around in /etc/ don't hurt.
>
Ah, I guess that makes sense.
Thanks!
--John
> On Wed, 08 Feb 2012 18:38:53 -0500, John Pietrzak wrote:
>> BTW, what is Debian's purpose on keeping conffiles around? Is there
>> value in having config info for nonexisting packages? (Should I not
>> be worried about leaving sudoers files in the sudoers.d directory?)
> A package might be removed only temporarily or in error, and be
> reinstalled again later. In that case the admin will be happy to find
> their carefully tweaked config files instead of having to re-create
> them from scratch (or grab them from a backup or an older git
> revision).
> And in general conffiles lying around in /etc/ don't hurt.
>
Ah, I guess that makes sense.
Thanks!
--John

John Pietrzak
I've been working on a small Maemo app, and have reached the point where
I've pushed it up to Extras-Devel. Almost everything works perfectly,
except for one item: I've created a sudoers file for the app, in order
to allow it to call "modprobe" to load a kernel module. (This is the
"lirc_rx51" module, needed for access to the IR hardware.) This file
needs to go into the /etc/sudoers.d directory.
I can install and uninstall the file just fine using the debian package
I've constructed locally. When installing the app from the Extras-Devel
repository, however, the application manager can place the file into
/etc/sudoers.d, but seems unable to remove it when uninstalling.
I'm using the Qt SDK, and have recently upgraded to Qt Creator 2.4.1, so
maybe the latest Qt software creates debian packages differently than
the Extras system does...
So, I guess these are my questions:
1) Do I need to do something special to install/uninstall files to the
/etc directory in Maemo?
2) Should I even be using /etc/sudoers.d to let my app access modprobe?
What is the preferred way for an app to make requests of the kernel?
Thanks!
--John