0

I am trying to do experiment with /etc/init. I have written a script which displays a window showing some menu. I don't understand on which event I should start my service. I don't want any desktop manager after booting so I disabled LightDM. Now I want that my script should execute to show my own menu after booting. How can I achieve this?? Please help..... I am using Ubuntu 13.04.

This is my script

  dialog --backtitle "Linux Shell Script Tutorial " --title "Main\
  Menu" --menu "Move using [UP] [DOWN],[Enter] to\
  Select" 15 60 3 \
  Date/time "Shows Date and Time" \
  Calendar "To see calendar " \
  Editor "To start vi editor " 2>/tmp/menuitem.$$

  menuitem=`cat /tmp/menuitem.$$`

  opt=$?

 case $menuitem in
 Date/time)  date;;
 Calendar)    cal;;
 Editor)       vi;;
 esac
papukaija
  • 2,425
Kishor
  • 33
  • 8

1 Answers1

1

You don't have any chance to run such a script during booting or before login screen. The reason: you must to be authorized/authentified to run commands like vi. If you wish, you can run that script on/at (immediately after) login. See How do I start applications automatically on login? in this sense.

Files in /etc/init are configuration files telling Upstart how and when to start, stop, reload the configuration, or query the status of a service.

Radu Rădeanu
  • 169,590
  • I added my script in /etc/init.d , and made a symlink of my script with /etc/rs2.d, And thats showing me a dialog box but that is in background process, I didnt know about this but during booting that dotted animation with UBUNTU word appeared and when I pressed arrow key (Up) then I saw that output of my script. But I very confused now, what should be the next step. – Kishor Jul 31 '13 at 05:29
  • @Kishor You will end probably with a broken system if you continue like this. – Radu Rădeanu Jul 31 '13 at 06:10
  • I know that . Please suggest me Is there any solution to meet my requirements? – Kishor Jul 31 '13 at 12:30
  • can I achieve this by using xinit ?? – Kishor Aug 09 '13 at 06:33
  • Well, see man xinit. – Radu Rădeanu Aug 09 '13 at 06:55
  • Got success with xsession. Now I can run my script without login and desktop manager. Thank you for your help. Feeling happy.. :) – Kishor Aug 10 '13 at 10:32