Auto-start for Situations app

Rating: 
4.22222
Your rating: None Average: 4.2 (27 votes)

This app for auto start Situations app (from jolla store) in background after reboot or lipstick restart.
Requires:
harbour-situations2application - should be installed.
python, dbus-python - to see notifications on the event screen.
lipstick-qt5-tools - to overwrite existing notification instead to collect them in the thread

Just activate developer mode before installation and dependencies packages should be installed automatically.

v0.1-17
- Small changes in the script.
- Compatible with v2.1.1.12.

v0.1-15
* Fix for ownership of some files. Now should work for all users. Added Tablet version.

v0.1-14
* Small changes in .spec file, changes for permission.

v0.1-13
* Small changes in .spec file

v0.1-12
* Small changes in .spec file

v0.1-11
* Added checking command if folder "user-session.target.wants" is existing. Now should work for all users.

v0.1-10
* Fixed small mistake in .spec file

v0.1-9
* App completely changed.
* Notification text changed a little bit.
* Will start service file after installation.
* Press on icon for stop/start service. If you will stop service, it will stop Situations app. Just reopen Situations app.
* Work also after reboot and lipstick restart
* Adaptation for 2.0.0.10.

v0.1-7
* Fix of notification icon. Adaptation for 1.1.9.28.

v0.1-6
* Fix of notification icon. Adaptation for 1.1.6.27.

v0.1-5
* Fix of small bug
* Added creating log file when Situation stuck over 90%, you will find it in /home/nemo/situationreboot.log.

v0.1-4
* Added auto-kill and restart of server if it stuck on over 90%, you will get notification about this. Thanks to Moth for Icons. .

v0.1-3
* Icon change to cool one, thanks to Moth.

v0.1-2
* Automatically enabled after installation.

Beware, use it on your own risk !!!

Donation are welcome :)

Screenshots: 
Application versions: 
AttachmentSizeDate
File situationreboot-0.1-15.armv7hl.rpm39.5 KB27/10/2015 - 21:40
File situationreboot-0.1-15.i486.rpm39.7 KB21/03/2016 - 05:34
File situationreboot-0.1-17.i486.rpm39.54 KB02/06/2017 - 18:38
File situationreboot-0.1-17.armv7hl.rpm40.44 KB02/06/2017 - 18:38
Changelog: 

- Small changes in the script.
- Compatible with v2.1.1.12

Comments

Moth's picture

Clean installation is possible again with v0.1-14.

But the service never gets enabled. I guess that's still the main problem with 1.1.9.28

Schturman's picture

No, wait... Please show me outputs of this commands:
stat -c "%a %n" /home/nemo/.config/systemd/user/user-session.target.wants/*
stat -c "%a %n" /home/nemo/.config/systemd/user
stat -c "%a %n" /home/nemo/.config/systemd
ls -l /home/nemo/.config/systemd
ls -l /home/nemo/.config/systemd/user
ls -l /home/nemo/.config/systemd/user/user-session.target.wants

Moth's picture

Interesting result: There's no folder "user-session.target.wants"

[root@Jolla nemo]# stat -c "%a %n" /home/nemo/.config/systemd/user/user-session.target.wants/*
stat: cannot stat `/home/nemo/.config/systemd/user/user-session.target.wants/*': Datei oder Verzeichnis nicht gefunden
[root@Jolla nemo]# stat -c "%a %n" /home/nemo/.config/systemd/user
755 /home/nemo/.config/systemd/user
[root@Jolla nemo]# stat -c "%a %n" /home/nemo/.config/systemd
755 /home/nemo/.config/systemd
[root@Jolla nemo]# ls -l /home/nemo/.config/systemd
total 0
drwxr-xr-x 1 root root 60 2014-02-06 00:22 user
[root@Jolla nemo]# ls -l /home/nemo/.config/systemd/user 
total 0
drwxr-xr-x 1 nemo privileged 54 2014-12-02 21:50 post-user-session.target.wants
[root@Jolla nemo]# ls -l /home/nemo/.config/systemd/user/user-session.target.wants
ls: cannot access /home/nemo/.config/systemd/user/user-session.target.wants: Datei oder Verzeichnis nicht gefunden
[root@Jolla nemo]#

 

 

Schturman's picture

Ok, now I understand why it not work for you...
On my device folder systemd and all subfolders is nemo:nemo, on your device it's root:root. This is a reason that .spec file can't create "user-session.target.wants" file.
Now please show me this 3 outputs, to know which app created this folder and service:
ls -l /home/nemo/.config|grep systemd
stat -c "%a %n" /home/nemo/.config/systemd/user/post-user-session.target.wants stat -c "%a %n" /home/nemo/.config/systemd/user/post-user-session.target.wants/*

Moth's picture

And the winner is...

[root@Jolla nemo]# stat -c "%a %n" /home/nemo/.config/systemd/user/post-user-sessi
on.target.wants
755 /home/nemo/.config/systemd/user/post-user-session.target.wants
[root@Jolla nemo]# stat -c "%a %n" /home/nemo/.config/systemd/user/post-user-session.target.wants/*
777 /home/nemo/.config/systemd/user/post-user-session.target.wants/harbour-mitakuuluu2.service
[root@Jolla nemo]#
Schturman's picture

Please show me also this output:

ls -l /home/nemo/.config|grep systemd

Moth's picture

Yep. :-)

[root@Jolla nemo]# ls -l /home/nemo/.config|grep systemd
drwxr-xr-x 1 root       root          8 2
014-02-06 00:22 systemd
Schturman's picture

Ok, now you have a few options....
1. If you want to try and solve it, try this command as root:
chown nemo:nemo /home/nemo/.config/systemd
chown nemo:nemo /home/nemo/.config/systemd/user
Do reboot and try if Mitakuulu continue to work like before. If not, you can restore it to what it was:
chown root:root /home/nemo/.config/systemd
chown root:root /home/nemo/.config/systemd/user
In this case you can't use situationreboot (for now at least).

2. If all is ok with Mitakuulu after changing the ownership, you can continue (as root):
su -l nemo -c "mkdir -p /home/nemo/.config/systemd/user/user-session.target.wants"
chmod 0755 /home/nemo/.config/systemd/user/user-session.target.wants

3. Now try to press on the icon of Situationreboot for On/Off to see if it work or not and check:
systemctl-user status situationreboot.service
pgrep -f situations2application
Maybe you need reboot once, to see the result...

Moth's picture

What a journey. Both services work like a charm now! :-D

Thank you so much for your effort! Sometimes things aren't that obvious, right? 

Keep it up!

Schturman's picture

Very Good! and now, can you do for me the last test, please ?
1. Press on the icon of Situationreboot to stop it.

2. Run as root:
/bin/rm -rf /home/nemo/.config/systemd/user/user-session.target.wants

3. Restore ownership as root:
chown root:root /home/nemo/.config/systemd
chown root:root /home/nemo/.config/systemd/user

4. Reboot your phone and check Mitakuulu again if all work.

5. Run as root:
mkdir -p /home/nemo/.config/systemd/user/user-session.target.wants
chown nemo:nemo /home/nemo/.config/systemd/user/user-session.target.wants
chmod 0755 /home/nemo/.config/systemd/user/user-session.target.wants

6. Now try to press on the icon of Situationreboot for On/Off to see if it work or not and check:
systemctl-user status situationreboot.service
pgrep -f situations2application
Maybe you need reboot once, to see the currect result...

Moth's picture

Yes, both services are still enabled after this measure. :-)

[root@Jolla nemo]# systemctl-user status situationreboot.service
Letzte Anmeldung: Dienstag, den 27. Oktober 2015, 19:02:44 CET
situationreboot.service - Situation auto-start
Loaded: loaded (/usr/lib/systemd/user/situationreboot.service; enabled)
Active: active (running) since Tue 2015-10-27 19:04:38 CET; 2min 14s ago
Main PID: 1171 (harbour-situati)
CGroup: /user.slice/user-100000.slice/
user@100000.service/situationreboot.service
└─1171 /usr/bin/harbour-sit...

[root@Jolla nemo]# pgrep -f situations2application
1171
[root@Jolla nemo]#
Schturman's picture

Very good ! Thank you very much for your help to understand this problem ! :)

You can leave it as is and In a few minutes I will upload fixed version.

Thank you!

Moth's picture

Always a pleasure. I did a clean install with v0.1-15 and everything's still working fine. :-)

Thanks again!

Schturman's picture

Cool! But if you wanted a clean install, you should uninstall previous version and also remove folder "user-session.target.wants":
/bin/rm -rf /home/nemo/.config/systemd/user/user-session.target.wants
Installation after this, you can call Clean install ;)

Moth's picture

Oh yes, that's exactly what I've done. Successful as mentioned above! :-D

Schturman's picture

Very Good! Thank you very much !

Schturman's picture

Ok, thanks for report.. Anymore I don't have any idea what else I can do. Sorry... Maybe it somehow related to jolla version 2.0.0.10. When you will update your phone, please try again.

Schturman's picture

Ok... Sorry man... I really don't know what else can we do...

Don't know why it not work on your device...

Schturman's picture

Ahhh, I tested only on the 2.0.0.10.

eson's picture

Will not install on my system. Error message on screen shot.

Schturman's picture

Activate dev mode first, or install this package manually before my app.

Schturman's picture

Please look in to this thread: http://talk.maemo.org/showpost.php?p=1485379&postcount=152

And also ask from author to create a correct auto-start service file. ;)

rob_k's picture

Since I installed Situtations and this Auto-start app yesterday, I experienced several freezes and auto-reboots. How do I uninstall the Auto-start for Situations app? It is not visible as an option in Warehouse.

Thanks for all the work, and I will go back to Auto-profile changer for now. :)

(Edit, I see: pkcon remove situationreboot, but it was not installed.)

Schturman's picture

1. from terminal as ROOT:
pkcon remove situationreboot

2. Long press on the icon and press on "x". Wait untill icon will disappear.

Moth's picture

kind regards ;)

Schturman's picture

Moth, can you create another one icon please ?
I need just white icon 64x64px (square with arrows on transparent background).

I work on update that can kill situation server when it stuck on over 90% CPU and restart server again. I need this icon for notifications.

Thanks

Moth's picture

Sure, can you work with the basic draft? Or do we need more? :-D

https://db.tt/JaWKHHjx

Regards

Schturman's picture

never mind, it looks good, I just added ".png" to the end of file and now I see it :)
thanks.

Moth's picture

The file got an update. Try the link above again! ;)

Schturman's picture

good, thanks! can you add "✔" in the middle, like in first icon ?

Pages