I'm new to linux for one week now. For the moment, linux mint is quite a pleasant os to use, but as I'm still new it is still inferior to "windows ?" in my hands in terms of productivity (which doesn't mean that I consider LM12 inferior of course, this is just a statement).
In an attempt to "customize" my OS and getting it better suited to my needs, I wish to be able to add scripts or programs to be launched on startup. After a bit of searches over this forum and the web, here is where I am:
=> A tip I could read was to go through the startup application manager, however (unless I made an embarrassing mistake) in LM12 LXDE, in the menu/preference what I have is the "desktop session settings" which seems to manage the startup program, and I wasn't able to find how to add a line or script. However, even if it would have worked this way the solution would have been totally distro-dependant since I would'nt have been able to do the same on another distro without this feature, so quite happily I thought that I had to learn a few things to get it work!
=> Tried to play with the /etc/init.d directory. What I basically did was:
1/ creating a test script in /etc/init.d:
test:
What I did here was taking another script which seemed to work at startup, deleting the entries which I though had only something to do with the initial task and not with mine. As I didn't really had a clue about what the lsb stuff at the beginning was here for, I did let it stay.#! /bin/sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="enables logitech g300 mouse to work properly"
NAME=test
SCRIPTNAME=/etc/init.d/$NAME
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# launches lxterminal
#
do_start()
{
lxterminal
}
#
# does nothing
#
do_stop()
{
}
case "$1" in
start)
do_start
;;
stop)
;;
restart|force-reload)
;;
esac
:
I also made the file executable through:
Code: Select all
chmod 755 /etc/init.d/test
I went
Code: Select all
sudo update-rc.d /etc/init.d/test defaults
(maybe I had to deal with some permission issues along the way also, I don't really remember, sorry about not being able to be more precise)
3/ Reboot and no lxterminal got launched.
I also have a few questions:
-> which programming language is used in "test"? I searched a few minutes though google but wasn't able to find it out, probably a keyword issue, I ask this because it will be faster and possibly more precise that way. If you think it is only laziness then sorry and don't take the time to answer
-> does the problem come from the command line to call the program? I did this way because I sort of thought that I read this was the way the previous file went to call programs.
-> how (very basically of course, just to get the starting idea from which I will be able to document myself efficiently) does the system boots (loading of kernel then??? in fact the "mechanics" of booting)
-> In my opinion, loading a script or a program on startup would be exactly the same in terms of command lines and stuff, because to read a script and having it have an effect I need to call a program which runs through the script. Am I right?
(if not then it's stupid for me to "test" by launching lxterminal because the first idea was to launch a script (to fix some hardware issue)
Thank you in advance, and sorry for the huge post!
Edit: I forgot to mention that I'm not really advanced in the world of computer sciences. I have a few basics of how things work, and had basics courses in the university and a few hours using python as a programming language but please consider me as someone who doesn't know a programming language, just switched to linux and wasn't an advanced user under windows.