| Prev | 9   17     18   19   20   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900) (https://talk.maemo.org/showthread.php?t=44576)

qwerty12 2010-02-26 17:09

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fatalsaint (Post 547843)
although I don't think depending on rootsh is a good idea.

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.

Quote:

Originally Posted by fatalsaint (Post 547843)
There must be some kind of API in dbus or somewhere to tell the device to reboot properly instead of running shell commands.

Code:

run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.req_reboot
Put the equivalent of that into your favourite solution for using D-Bus in an app (DBus-GLib, libosso, python-osso, python-dbus, libdbus, QDBus, ..)
http://maemo.org/api_refs/5.0/5.0-fi...-names_8h.html explains some more of the method calls available to you.

noobmonkey 2010-02-26 17:16

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
wow very helpful :D - just need to understand Dbus now! ... hmmmmmm

noobmonkey 2010-02-26 17:18

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
getting a dbus.error.UnknownMethod "req_reboot" with signature "" on interface "com.nokia.mce.request" doesn't exist.

qwerty12 2010-02-26 17:22

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by noobmonkey (Post 547857)
getting a dbus.error.UnknownMethod "req_reboot" with signature "" on interface "com.nokia.mce.request" doesn't exist.

Apologies. It got moved to DSME. Try:
Code:

run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.dsme" --print-reply "/com/nokia/dsme/request" com.nokia.dsme.request.req_reboot

noobmonkey 2010-02-26 17:25

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by qwerty12 (Post 547861)
Apologies. It got moved to DSME. Try:
Code:

run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.dsme" --print-reply "/com/nokia/dsme/request" com.nokia.dsme.request.req_reboot

Lol - don't apologise - by getting it wrong you did actually force me to hunt the answer out :)

Just tested it and works fine! - wohooo! :D - slowly getting there - i think i've bitten of a little mor ethen i should have for my first project - but it is still fun!!

noobmonkey 2010-02-26 17:27

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
But you have got me wanting to test this bit now!!

Vibrator interface D-Bus methods
:D :D :D

noobmonkey 2010-02-26 17:35

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Qwerty... thats got me thinking, as i have a load of other commands i'd like to run.... - may be best for me to seek alternatives...

apt-get clean
apt-get install pymaemo-optify (possibly)

even looking at using the cleanup script to run externally as part of the application....
Code:

#!/bin/sh
# Nokia N900 Maemo 5 Script to free up space on rootfs
# ignoring errors when creating dirs that may already exist

# Moving themes to /home/opt
mkdir -p /home/opt/usr/share/themes 2> /dev/null
cp -r /usr/share/themes/* /home/opt/usr/share/themes
rm -r /usr/share/themes
ln -s /home/opt/usr/share/themes /usr/share/themes

# Moving ?? icons to /home/opt
mkdir -p /home/opt/usr/share/icons 2> /dev/null
cp -r /usr/share/icons/* /home/opt/usr/share/icons
rm -r /usr/share/icons
ln -s /home/opt/usr/share/icons /usr/share/icons

# Moving video on start-up to /home/opt
mkdir -p /home/opt/usr/share/hildon-welcome 2> /dev/null
cp -r /usr/share/hildon-welcome/* /home/opt/usr/share/hildon-welcome
rm -r /usr/share/hildon-welcome
ln -s /home/opt/usr/share/hildon-welcome /usr/share/hildon-welcome

# ??
mkdir -p /home/opt/usr/share/pixmaps 2> /dev/null
cp -r /usr/share/pixmaps/* /home/opt/usr/share/pixmaps
rm -r /usr/share/pixmaps
ln -s /home/opt/usr/share/pixmaps /usr/share/pixmaps

# Moving 'apt cache' to /home/opt - Valid until Bug 5746 is fixed.
mkdir -p /home/opt/var/cache/apt 2> /dev/null
cp -r /var/cache/apt/* /home/opt/var/cache/apt
rm -r /var/cache/apt
ln -s /home/opt/var/cache/apt /var/cache/apt


fatalsaint 2010-02-26 18:24

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by qwerty12 (Post 547861)
Apologies. It got moved to DSME. Try:
Code:

run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.dsme" --print-reply "/com/nokia/dsme/request" com.nokia.dsme.request.req_reboot

I knew it existed.. just couldn't look it up.

Thanks for the save.

noobmonkey 2010-02-26 19:23

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Is this call still valid?

Just not returning anything for me?
Code:

run-standalone.sh dbus-send --system --type=signal /com/nokia/mce/signal com.nokia.mce.signal.sig_device_orientation_ind

noobmonkey 2010-02-26 19:34

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
hmmm does nothing at all in terminal either.... am i missing an import?!


| Prev | 9   17     18   19   20   | Next
All times are GMT. The time now is 19:33.

vBulletin® Version 3.8.8