[Community] GTA04 - Power management improvements
Dr. H. Nikolaus Schaller
hns at goldelico.com
Wed Jan 29 12:53:20 CET 2014
Am 29.01.2014 um 12:24 schrieb Sebastian Krzyszkowiak:
> On 1/29/14, Hermann Schwärzler <hermann.schwaerzler at chello.at> wrote:
>> On 01/29/2014 09:34 AM, Dr. H. Nikolaus Schaller wrote:
>>> Am 29.01.2014 um 09:07 schrieb Hermann Schwärzler:
>>>> So I propose to call it when a device-shutdown is requested. E.g.
>>>> in QtopiaServerApplication::shutdown()? But this is for sure
>>>> device-dependent so there might be a better place...
>>> The optimal solution would be to have it in some "shutdown" script
>>> that is installed within Debian. I.e. something that is executed if
>>> "poweroff" is done on the command line or called from
>> In QtopiaServerApplication::shutdown
>> execlp("shutdown", "shutdown", "-h", "now", (void*)0);
>> is called. So if a script named "shutdown" is put into /opt/qtmoko/bin/
>> it should be possible to get the desired effect as /opt/qtmoko/bin/ is
>> at the very beginning of the PATH.
>> I will check (again over night).
> QtMoko is Debian based, isn't it? The "correct way" of dealing with
> "do something at shutdown" problem would be to write an init script,
> put it in /etc/init.d/ and symlink to appropiate runlevels
> (/etc/rc0.d/ for shutdown and /etc/rc6.d/ for reboot). This is the
> standard way to stop services during shutdown and stopping modem IMO
> fits pretty well into that process - and it doesn't feel like a hack
> like previous propositions here.
Yes, that is the direction I had tried. But I tried to overwrite the
/etc/init.d/ups-monitor script but your proposal "feels" even more
More information about the Community