Autolaunch a Perl Script . . .

Thanks for stopping by...

With Yoda's help, I was able to suss out the following syntax for command-prompt launch of a script using "which perl":

"$( which perl )" /etc/something.pl

I thought things would be easy from there, but after a number of different permutations of the above command placed in rc.local, nothing seems to fly.

OTOH, (right or wrong) this works as an "Application Autostart" in Xubuntu 12.04:

bash -c "$( which perl ) /etc/something.pl"

:rolleyes:

How does something like this to translate over to rc.local?

Thanks a bunch --

Try:

`which perl` /etc/something.pl

@bartus11:

Just gave it a whirl: No dice...

:o

Not sure what exactly you are trying to achieve, try this:

PERL_BIN="$( which perl )"

bash -c "$( $PERL_BIN /etc/something.pl )"

@Yoda:

Thanks again for stopping by! Great command line; but it didn't work in rc.local :confused:

Thought this would be easy; but it seems like a real bugger...

What, exactly, does this perl script do? It may need things that it can only get from being run inside a logged-in session, which an autostart wouldn't have...

@Corona688:

Without going into unnecessary detail, it fires off a zenity box for the user to acknowledge.

Nothing special at all.

Would like to go with rc.local if I can; but Application Autostart is an OK fallback if needed.

Yes, that is the detail needed. Your user got an X credentials file or something similar by logging into the computer... Anything inside that logged-in session, including programs launched by their autostarter, will share those credentials and be allowed to use the X session.

Things run by rc.local on the other hand do not.

For that matter, rc.local would get run even if your machine had no X server, so there's no guarantee it'd wait for X to start first.

Running it from inside the user session as you have, is a much better solution IMHO. You could also try messing with the xinitrc config file.

1 Like

Thanks for clearing up the mystery, Corona688! Would never've guessed...

Richer for the interchange, I will now "autostart in peace" :wink:

Have a great day, folks!

1 Like