3

I am new to Linux and just started using ubuntu 14.04. I'm trying to run imwheel process on startup by editing rc.local file. Perhaps I'm doing something wrong and I need to type a path to a program apart just the name like in terminal?

when i try to do a check by running:

sudo service rc.local start

I get below message:INFO:

imwheel started (pid=4906)
Could not open display, check shell DISPLAY variable, and export or setenv it!

rc.local file:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

imwheel

exit 0
L. D. James
  • 25,036
Trm
  • 1,015

1 Answers1

6

The imwheel is a GUI application that runs under X. You don't have X running, nor an X DISPLAY available when the rc.local file is run.

You'll have an X DISPLAY after you log in. So to have this automatically run you should set it up as one of your startup application.

You can get to your Startup Applications configuration by typing "Startup Applications" in the Ubuntu Launch button search field.

Just click Add, then for the three fields put:

  • A name for the entry (any that you choose)
  • The command (in this case) imwheel
  • A comment (optional - to remind you what it does)

Click Add to save the new startup application, then close the window.

L. D. James
  • 25,036
  • Thanks for the answer. I guess I had a wrong misconception about rc.local and it's purpose. – Trm Nov 22 '15 at 21:52
  • @Trm I'm sure your impression of what it's for was correct. It's for running commands or starting applications at bootup. Of course if you wanted to start a CD to playing and there isn't a CD in the player, it would give you an appropriate error message. It would run the program, but you won't get the desired effect unless you have the the necessary configuration. In this immediate place you need a DISPLAY to run the imwheel application. There are many commands that are available to run that doesn't require a gui interface. – L. D. James Nov 22 '15 at 22:11
  • Startup Applications isn't available in Xubuntu. How do I do it here? – Gabriel Staples Aug 02 '17 at 19:58
  • Found it! Click Start menu and search for "Session and Startup" --> click "Application Autostart" tab --> click "Add" at bottom and add the command imwheel. It works! Screenshots to some of these menus is here: https://askubuntu.com/a/369443/327339 – Gabriel Staples Aug 02 '17 at 20:09
  • Glad you found it. I was about to install Xubuntu to see the best step for locating it. I'm sure it would just be a matter of placing an entry in ~/config/autostart. – L. D. James Aug 02 '17 at 20:22