Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

[SOLVED BIG TIME] Custom command failing in Application Autostart

Help for Current Versions of MX
User avatar
Captain Brillo
Forum Regular
Forum Regular
Posts: 198
Joined: Mon Jan 07, 2019 12:29 am

[SOLVED BIG TIME] Custom command failing in Application Autostart

#1

Post by Captain Brillo » Mon Jan 07, 2019 1:12 am

Hi, all.
Just installed this distro for first time. Looks good.

First issue, first post:

I've tested this command, it's definitely good from the command line, and putting it in as a Startup app works elsewhere. It auto-connects to my VPN.

Code: Select all

<usr/bin>/nmcli con up uuid e631de5a-9d59-47f2-b19a-c64c7ae1dd38
But I can't get the "Session and Startup" / "application autostart" to run it at start up.

What might be the issue?
Last edited by Captain Brillo on Mon Jan 07, 2019 10:57 pm, edited 2 times in total.
GAFA-free zone

User avatar
Eadwine Rose
Forum Veteran
Forum Veteran
Posts: 8942
Joined: Wed Jul 12, 2006 2:10 am

Re: Custom command failing in Application Autostart

#2

Post by Eadwine Rose » Mon Jan 07, 2019 11:01 am

The < and > things shouldn't be in there.


/usr/bin/nmcli etc.
MX-18.3_x64 May 26 2019 * 4.19.0-5-amd64 ext4 Xfce 4.12.3 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 390.116 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy5030

User avatar
Captain Brillo
Forum Regular
Forum Regular
Posts: 198
Joined: Mon Jan 07, 2019 12:29 am

Re: Custom command failing in Application Autostart

#3

Post by Captain Brillo » Mon Jan 07, 2019 1:47 pm

my bad.

I was trying to imply that I'd tried the command with and without "/usr/bin/" on it.

This system won't let me run shell scripts either; I tried making an executable bash script, says so under properties, but I can't get it to run either. I even made sure the shell is bash.
using

Code: Select all

ls -al
gets this line:

Code: Select all

-rwxr-xr-x  1 owner owner    77 Jan  7 00:34 startvpn.sh
-a bunch of "x"s

What is it that's going - does this distro work differently?

:confused:
GAFA-free zone

User avatar
timkb4cq
Forum Veteran
Forum Veteran
Posts: 5121
Joined: Wed Jul 12, 2006 4:05 pm

Re: Custom command failing in Application Autostart

#4

Post by timkb4cq » Mon Jan 07, 2019 2:12 pm

What may be happening is that the command is running before the network is completely up.
There's a reason ncmli has an optional parameter ifname <ifname> e.g. ifname /dev/wlan0
It's used when a particular device is required to activate the connection on. I would try adding that parameter to the end of your nmcli command line so it will wait for the device to become available.
MSI 970A-G43 MB, AMD FX-6300 (six core), 16GB RAM, GeForce 730, Samsung 850 EVO 250GB SSD, Seagate Barracuda XT 3TB

User avatar
dolphin_oracle
Forum Veteran
Forum Veteran
Posts: 12185
Joined: Sun Dec 16, 2007 1:17 pm

Re: Custom command failing in Application Autostart

#5

Post by dolphin_oracle » Mon Jan 07, 2019 2:18 pm

**edited because I didn't read enough***
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad T530 - MX-18.3
lenovo s21e - antiX-19 beta 2 (live-USB)
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
dolphin_oracle
Forum Veteran
Forum Veteran
Posts: 12185
Joined: Sun Dec 16, 2007 1:17 pm

Re: Custom command failing in Application Autostart

#6

Post by dolphin_oracle » Mon Jan 07, 2019 2:28 pm

maybe putting quotes around the command that you are putting in "session and startup".

as to your script, did you remember the shebang in the first line of the script?
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad T530 - MX-18.3
lenovo s21e - antiX-19 beta 2 (live-USB)
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
Captain Brillo
Forum Regular
Forum Regular
Posts: 198
Joined: Mon Jan 07, 2019 12:29 am

Re: Custom command failing in Application Autostart

#7

Post by Captain Brillo » Mon Jan 07, 2019 3:41 pm

Possibly - define "shebang" in this case?
GAFA-free zone

User avatar
dolphin_oracle
Forum Veteran
Forum Veteran
Posts: 12185
Joined: Sun Dec 16, 2007 1:17 pm

Re: Custom command failing in Application Autostart

#8

Post by dolphin_oracle » Mon Jan 07, 2019 3:50 pm

Captain Brillo wrote:
Mon Jan 07, 2019 3:41 pm
Possibly - define "shebang" in this case?
for scripting,you need a line at the top of the script that tells what command intrepter to use, in this case bash.

Code: Select all

#!/bin/bash
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad T530 - MX-18.3
lenovo s21e - antiX-19 beta 2 (live-USB)
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
Captain Brillo
Forum Regular
Forum Regular
Posts: 198
Joined: Mon Jan 07, 2019 12:29 am

Re: Custom command failing in Application Autostart

#9

Post by Captain Brillo » Mon Jan 07, 2019 4:14 pm

yes, I have that.

Code: Select all

#!/bin/bash
#StartVPN
nmcli con up uuid e631de5a-9d59-47f2-b19a-c64c7ae1dd38
What's missing?

I've tried all the suggestions re startup, quotes, "ifname" "-w20" etc., but I can't get any to work. Probably cuz there don't actually appear to be ANY examples of how to use this that I can understand.
AND, it seems that none of my scripts from the last distro will work.
I'm missing something, here...

:bawling: :p
GAFA-free zone

User avatar
Captain Brillo
Forum Regular
Forum Regular
Posts: 198
Joined: Mon Jan 07, 2019 12:29 am

Re: Custom command failing in Application Autostart

#10

Post by Captain Brillo » Mon Jan 07, 2019 4:44 pm

@timkb4cq
There's a reason ncmli has an optional parameter ifname <ifname> e.g. ifname /dev/wlan0
I can't find any examples of how to write this - or how to place the wait switch '-w' or seconds '20'

Can somebody try to get the syntax right for this thing?

Code: Select all

nmcli con up ifname /dev/tun0  uuid e631de5a-9d59-47f2-b19a-c64c7ae1dd38
- where would i put '-w20' or '-w 20' for a 20 second wait?

Every way I try has something wrong with except the basic

Code: Select all

nmcli con up uuid e631de5a-9d59-47f2-b19a-c64c7ae1dd38
And I can get scripts working in terminal, or in the File manager drop down run command - but that's it.
GAFA-free zone

Post Reply

Return to “MX Help”