Article 6HPGJ using systemd to run script after logged to desktop [gnome-shell] guake core dumps.

using systemd to run script after logged to desktop [gnome-shell] guake core dumps.

by
//////
from LinuxQuestions.org on (#6HPGJ)
what am i doing wrong here?

i am trying to autostart a script with systemd, with service file.
guake part of my systemd service file has some bug.

i have chmod'ed 644 /etc/systemd/system/autostart.service
/etc/systemd/system/autostart.service below.

Code:[Unit]
Description=Setup

[Service]
ExecStart=/usr/local/bin/setup.sh

[Install]
WantedBy=graphical.target
# that were multi.user.target but it didnt work.i have chmod'ed 755 /usr/local/bin/setup.sh
and
Code:systemctl enable autostart.service
/usr/local/bin/setup.sh is below.
Code:#!/bin/bash

function Guake {

pid=$(pgrep guake)
if [[ -z "$pid" ]]; then

echo " Starting Guake."
/usr/bin/guake &

else

echo " Guake is already running."

fi
}

function Plank {

pid=$(pgrep plank)
if [[ -z "$pid" ]]; then

echo " Starting Plank."
/usr/bin/plank &

else

echo " Plank is already running."

fi
}

function Conky {

pid=$(pgrep conky)
if [[ -z "$pid" ]]; then

echo " Starting Conky."
/usr/bin/conky -dc /home/vile/conky/conkyrc

else

echo " Conky is already running."

fi
}

function Snitch {

pid=$(pgrep opensnitchd)
if [[ -z "$pid" ]]; then

echo " Starting Opensnitchd."
cd /home/vile
/usr/bin/opensnitchd &

#exit 0

else

echo " Opensnitchd is already running."
#exit 0

fi
}

Guake
sleep 1

Plank
sleep 1

Conky
sleep 1

Snitch

exit 0Code:[root@arch vile]# systemctl status autostart.service
autostart.service - Setup
Loaded: loaded (/etc/systemd/system/autostart.service; enabled; preset: disabled)
Active: inactive (dead) since Mon 2024-01-08 22:16:09 EET; 1min 5s ago
Duration: 13.182s
Process: 662 ExecStart=/usr/local/bin/setup.sh (code=exited, status=0/SUCCESS)
Main PID: 662 (code=exited, status=0/SUCCESS)
CPU: 411ms

Jan 08 22:16:06 arch setup.sh[1896]: Language previously loaded from: /usr/share/locale
Jan 08 22:16:06 arch guake[1896]: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Jan 08 22:16:06 arch guake[1896]: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Jan 08 22:16:06 arch guake[1896]: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Jan 08 22:16:07 arch setup.sh[662]: /usr/local/bin/setup.sh: line 78: 1896 Segmentation fault (core dumped) /usr/bin/guake
Jan 08 22:16:07 arch setup.sh[662]: Starting Plank.
Jan 08 22:16:07 arch plank[1937]: cannot open display:
Jan 08 22:16:08 arch setup.sh[662]: Conky is already running.
Jan 08 22:16:09 arch setup.sh[662]: Starting Opensnitchd.
Jan 08 22:16:09 arch systemd[1]: autostart.service: Deactivated successfully.i know there would be easier methods but i want to learn systemd way of doing things :P

EDIT: i am using arch linux. DE: GNOME 45.3
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments