I want to define a file to be executed upon system startup in Fedora 20. I made this simple file and saved it in "/etc/init.d"
This code should output a couple messages, depending on which argument is supplied, and also create a file names "init" and a directory named "from_init" in my home directory. Everything works perfectly if I run it like this:
:source ./myfirstinit start"
However, let's say I run it like this: "systemctl start myfirstsysteminit" it doesn't appear to do anything. An entry in the system log shows : SYS ... first init script for testing, which is the description in the file. That shows that systemctrl finds the right script and tries to execute it, but none of the other things happed.
Supposedly, this old style init file should be supported in Fedora 20. Can anyone see anything I'm doing wrong?
Code:
#!/bin/sh /etc/rc.common
#chkconfig: 2345 20 80
#description: first init script for testing
start() {
echo "Hello World from myfirstinit start"
mkdir /home/danny/from_init
}
stop() {
echo "Hello World from myfirstinit stop"
}
echo -n $"MyFirstInit" > /home/danny/init
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
stop
start
;;
*)
echo $"usage $0 {start | stop}"
exit 2
esac
:source ./myfirstinit start"
However, let's say I run it like this: "systemctl start myfirstsysteminit" it doesn't appear to do anything. An entry in the system log shows : SYS ... first init script for testing, which is the description in the file. That shows that systemctrl finds the right script and tries to execute it, but none of the other things happed.
Supposedly, this old style init file should be supported in Fedora 20. Can anyone see anything I'm doing wrong?