I am currently using RHEL 7.0 for our project. I have an embeded application which I want to run on boot up. I have an exe file for the same. I have tried using the systemctl command but it has not helped. I also tried editing the inittab file but that didn't help too. I also tried adding a rc.local file and edit the rc.d to add the execution of rc.local but it said that the file cannot be modified. (I was in sudo mode when I tried this).I wish to start the application on boot up without asking a user to login. Also where should we keep our exe in filesystem so that it will be detected at startup. Can someone please guide on how can I achieve this ?
Start Application on Start up
fedora;rhel
You can use the following unit file as a template:[Unit]Description=A Test Service That Prints the dateAfter=network.target[Service]EnvironmentFile=-/etc/sysconfig/myserviceExecStart=/usr/bin/bash -c /usr/bin/date >> /now.txt $MYSERVICE_ARGS[Install]WantedBy=multi-user.targetSave it in /etc/systemd/system/ with a .service file extension (for example  /etc/systemd/system/myservice.service)Any environment variables that are needed by your application can be placed in /etc/sysconfig/myservice, including the creation of a variable to hold your command line options:MYSERVICE_ARGS=--posix(If you use a variable for the command line options, then add the variable to your command in ExecStart as follows: ExecStart=/usr/local/bin/myservice $MYSERVICE_ARGS)Test it with:# systemctl start myserviceYou should now have a file /now.txt that has the date/time appended every time this is run.Enable it to start at boot with:# systemctl enable myserviceIt should now start automatically after networking comes up.Alter the ExecStart line to run your application.  Remember that systemd doesn't run ExecStart in a shell therefore if you need redirection, for example, then you'll need to run bash -c as per the example.  Also, there will not be a $PATH variable, therefore use full paths.  The application will be run as user root.There are far more options that you can use - read the man page.  Also, browse your system's unit files in /usr/lib/systemd/system.