Notices


Reply
Thread Tools
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#191
ok, right tidied up the app ready to lean this bit.....
I'm going to sound incredibly noobish... (Tis all in the name i say!)......

Precisely. Place a file in /etc/sudoers.d with a command that you want whitelisted for running as root via sudo (standard sudoers syntax), instead, and run "update-sudoers" in the postinst and postrm scripts of the package.
I'm assuming that means for example if i want to run apt-get clean
It needs to be added somehow to /etc/sudoers.d


Not sure what you mean by -
run "update-sudoers" in the postinst and postrm scripts of the package.
My package is pretty simple... 2 py files and the usual desktop, service and icons...
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Posts: 196 | Thanked: 54 times | Joined on Jan 2010 @ UK
#192
two files in debian control

postinst & postrm
Code:
#!/bin/sh

#update sudoers

update-sudoers
create the following file

etc/sudoers.d/healthcheck.sudoers
Code:
user ALL = NOPASSWD: /<path>/command
put all the commands you need to run as root.

this will allow commands to be run as root when your package is installed, and stopped when package is removed.
 

The Following 2 Users Say Thank You to fred123 For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#193
Originally Posted by fred123 View Post
two files in debian control

postinst & postrm
Code:
#!/bin/sh

#update sudoers

update-sudoers
create the following file

etc/sudoers.d/healthcheck.sudoers
Code:
user ALL = NOPASSWD: /<path>/command
put all the commands you need to run as root.

this will allow commands to be run as root when your package is installed, and stopped when package is removed.


wow thank you!!!!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#194
ok... getting there i think now...
SO for example my sudoers file would for example look like this?

user ALL = NOPASSWD: /apt-get %users ALL = NOPASSWD: /sbin/reboot

i'm assuming id i put apt-get in there, i can use all apt-get commands if needed?
(Just tring to find apt-get so i can put it in the right path...


Now.....
two files in debian control

postinst & postrm
No idea what you mean, as when i package i then use autobuilder - and tbh - never heard of debian control etc... (Really new to linux and python, sorry)

But the code looks just like something i need to put in a file!..
Code:
#!/bin/sh

#update sudoers

update-sudoers
So am i right i nthinking i need to create a postinst & postrm file with this code in it? ... if so, where do i put these files, and how to they get run? (Auto by app manager?)


Sorry for the multiple q's!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Posts: 196 | Thanked: 54 times | Joined on Jan 2010 @ UK
#195
user ALL = NOPASSWD: /apt-get %users ALL = NOPASSWD: /sbin/reboot
Code:
user ALL = NOPASSWD: /apt-get
user ALL = NOPASSWD: /sbin/reboot
one command per line

postinst & postrm go in /DEBIAN folder in your package folder structure.

I am just starting with linux development as well, used to do .net dev on windows this quite different!
 

The Following User Says Thank You to fred123 For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#196
w00000p thank you! - will work on this tomorrow yay!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#197
hmmmmm need some help peoples... (no change here then!)

At the moment i read the firmware versions and return something like PR1.1 - or PR1.1.1 ....
Quite easy to do at the moment... but i will hit a snag when new firmware versions come out, as i will have to update the code, then wait the 10+ days to get it out to people.... Not much help...

A few way rounds i can think of are....
Listing the versions on my website and parsing it directly from there (not good if people dont have or want to use the internet.)

or

Giving the user the ability to download a text file with them listed in, and update when they want.

Are there any other ways people can think off? or any previous good examples?
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Posts: 124 | Thanked: 4 times | Joined on Nov 2009 @ uk
#198
hi, cant upgrade tp latest version as it say i need audiopulse installed.
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#199
Originally Posted by noobmonkey View Post
hmmmmm need some help peoples... (no change here then!)

At the moment i read the firmware versions and return something like PR1.1 - or PR1.1.1 ....
Quite easy to do at the moment... but i will hit a snag when new firmware versions come out, as i will have to update the code, then wait the 10+ days to get it out to people.... Not much help...

A few way rounds i can think of are....
Listing the versions on my website and parsing it directly from there (not good if people dont have or want to use the internet.)

or

Giving the user the ability to download a text file with them listed in, and update when they want.

Are there any other ways people can think off? or any previous good examples?

you could parse the firmware download site, which should
be upto date within 24 hours of OTA. ?
__________________
N900_Email_Options Wiki Page
 

The Following User Says Thank You to mikec For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#200
hehe. i would have no idea where to start on that one. didnt realise you could pull off a list from there? good idea though!!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Reply

Tags
code, health check, n900, python

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:26.