![]() |
[Question] How to write start-up scripts?
I was under the impression you can write scripts and put them in /etc/init/apps. But I can't seem to get mine to work. I would like to write one to delete /home/user/.local/share/applications/simatk.desktop at startup, which is a useless app put there by my SIM card provider and which is recreated at every startup if it is not present.
Is there a tutorial somewhere or can we have a little thread to walk through writing scripts to run at startup and solve problems, etc? |
Re: [Question] How to write start-up scripts?
So here is what I did. First I wrote a script to delete the offending .desktop file:
Code:
sleep 45 That is saved as /usr/include/del-t-mobile.sh Then I executed Code:
chmod a+rx /usr/include/del-t-mobile.sh Now I created the following file Code:
description "Deletes the program icon for T-Mobile SIM card" In theory this should work, but it doesn't. Running the script del-t-mobile.sh manually works fine; for some reason t-mobile.conf does not call it at startup. So what am I doing wrong? |
Re: [Question] How to write start-up scripts?
Well, on my N900, if I ever want to start a script at bootup, I usually create a file in etc/event.d like:
/etc/event.d/dbus-scripts-session which I used to start dbus-scripts when my N900 starts. it contains: Code:
start on started hildon-desktop |
Re: [Question] How to write start-up scripts?
I believe this is disabled by aegis on the N9. I cannot create files in /etc/init.d/ even as root. The directory /etc/init/apps is, I believe, intended for applications to be able to have daemons, and I'm sort of piggy-backing on that... still stuck
|
Re: [Question] How to write start-up scripts?
Quote:
|
Re: [Question] How to write start-up scripts?
Try doing it with "exec sh /usr/include/del-t-mobile.sh" as i don't think the user are allowed to do that ;)
But i am sure there is a cleaner way in doing this. Isn't that just an app icon? |
Re: [Question] How to write start-up scripts?
Quote:
|
Re: [Question] How to write start-up scripts?
Have you looked in "/etc/init/xsession*" or "/etc/default/*" ? Be careful though as changing this things could brick the phone.
|
Re: [Question] How to write start-up scripts?
/etc/init/apps/*.conf autostart always work fine. autostart started after some seconds after reboot.
|
Re: [Question] How to write start-up scripts?
Running a script using "exec <script>" will run it as root. Trying to use "exec aegis-exec -s -u user" will run the script as nobody even though you specified user. I think you need to package your script in a .deb to get it signed by aegis when you install it to be able to run it as a different user with aegis-exec.
|
All times are GMT. The time now is 19:48. |
vBulletin® Version 3.8.8