Score:0

Crontab not opening gnome-terminal

in flag

Configured crontab to run a script.

crontab config

* * * * * export DISPLAY=:0 && sh $HOME/path/to/script >> /tmp/error.llog 2>&1

Script

gnome-terminal --window -e "sudo ifconfig wlo1 down; sleep 1; sudo ifconfig wlo1 up"

Whenever the script is executed I'm getting the following error message.

Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Could not connect: Connection refused

Locale configs

LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE="en_IN"
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=

vanadium avatar
cn flag
Comments indicate that this "script is working on the ubuntu 21.04 machine but it is not working on a 16.04 machine". Debugging an EOL system is out of scope of the site.
Score:1
cn flag

You really do not want to open Gnome Terminal this way. Cron is not designed to be used for starting graphical applications. Use "autostart" in your desktop environment to automatically open a terminal emulator.

Baskaran Panneerselvam avatar
in flag
It is a time-triggered script and so I'm using crontab. The script is working on the ubuntu 21.04 machine but it is not working on a 16.04 machine
vanadium avatar
cn flag
Does your question relate to Ubuntu 16.04? That looks a pretty old version to me for which the site does not anymore give support.
Baskaran Panneerselvam avatar
in flag
Yes, the Ubuntu version is 16.04. The site doesn't give any support but the crontab should work right?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.