Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 944 characters in body
Source Link
programmer
  • 1.1k
  • 7
  • 17
  • 35

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

EDIT: here is what sudo systemctl status myfirst give me:

Warning: The unit file, source configuration file or drop-ins of myfirst.service changed on >disk. Run 'systemctl daemon-reload' to reload units.
● myfirst.service - Command Service
     Loaded: loaded (/etc/systemd/system/myfirst.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2020-08-26 21:07:02 BST; 15min18min ago
    Process: 332 ExecStart=/etc/startupjobscript (code=exited, status=255/EXCEPTION)
   Main PID: 332 (code=exited, status=255/EXCEPTION)

Aug 26 21:07:01 archlinux systemd[1]: Starting Command Service...
Aug 26 21:07:02 archlinux startupjobscript[337]: Cannot open display "default display"
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Main process exited, code=exited, sta>status=255/EXCEPTION
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Failed with result 'exit-code'.
Aug 26 21:07:02 archlinux systemd[1]: Failed to start Command Service.

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

EDIT: here is what sudo systemctl status myfirst give me:

Warning: The unit file, source configuration file or drop-ins of myfirst.service changed on >
● myfirst.service - Command Service
     Loaded: loaded (/etc/systemd/system/myfirst.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2020-08-26 21:07:02 BST; 15min ago
    Process: 332 ExecStart=/etc/startupjobscript (code=exited, status=255/EXCEPTION)
   Main PID: 332 (code=exited, status=255/EXCEPTION)

Aug 26 21:07:01 archlinux systemd[1]: Starting Command Service...
Aug 26 21:07:02 archlinux startupjobscript[337]: Cannot open display "default display"
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Main process exited, code=exited, sta>
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Failed with result 'exit-code'.
Aug 26 21:07:02 archlinux systemd[1]: Failed to start Command Service.

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

EDIT: here is what sudo systemctl status myfirst give me:

Warning: The unit file, source configuration file or drop-ins of myfirst.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● myfirst.service - Command Service
     Loaded: loaded (/etc/systemd/system/myfirst.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2020-08-26 21:07:02 BST; 18min ago
    Process: 332 ExecStart=/etc/startupjobscript (code=exited, status=255/EXCEPTION)
   Main PID: 332 (code=exited, status=255/EXCEPTION)

Aug 26 21:07:01 archlinux systemd[1]: Starting Command Service...
Aug 26 21:07:02 archlinux startupjobscript[337]: Cannot open display "default display"
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Main process exited, code=exited, status=255/EXCEPTION
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Failed with result 'exit-code'.
Aug 26 21:07:02 archlinux systemd[1]: Failed to start Command Service.

added 944 characters in body
Source Link
programmer
  • 1.1k
  • 7
  • 17
  • 35

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

EDIT: here is what sudo systemctl status myfirst give me:

Warning: The unit file, source configuration file or drop-ins of myfirst.service changed on >
● myfirst.service - Command Service
     Loaded: loaded (/etc/systemd/system/myfirst.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2020-08-26 21:07:02 BST; 15min ago
    Process: 332 ExecStart=/etc/startupjobscript (code=exited, status=255/EXCEPTION)
   Main PID: 332 (code=exited, status=255/EXCEPTION)

Aug 26 21:07:01 archlinux systemd[1]: Starting Command Service...
Aug 26 21:07:02 archlinux startupjobscript[337]: Cannot open display "default display"
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Main process exited, code=exited, sta>
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Failed with result 'exit-code'.
Aug 26 21:07:02 archlinux systemd[1]: Failed to start Command Service.

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

EDIT: here is what sudo systemctl status myfirst give me:

Warning: The unit file, source configuration file or drop-ins of myfirst.service changed on >
● myfirst.service - Command Service
     Loaded: loaded (/etc/systemd/system/myfirst.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2020-08-26 21:07:02 BST; 15min ago
    Process: 332 ExecStart=/etc/startupjobscript (code=exited, status=255/EXCEPTION)
   Main PID: 332 (code=exited, status=255/EXCEPTION)

Aug 26 21:07:01 archlinux systemd[1]: Starting Command Service...
Aug 26 21:07:02 archlinux startupjobscript[337]: Cannot open display "default display"
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Main process exited, code=exited, sta>
Aug 26 21:07:02 archlinux systemd[1]: myfirst.service: Failed with result 'exit-code'.
Aug 26 21:07:02 archlinux systemd[1]: Failed to start Command Service.

Fixed a few misspellings, simplified wording, formatted file names as code; removed the OS tag (it doesn't seem to be an Arch-specific issue)
Source Link
fra-san
  • 10.8k
  • 2
  • 27
  • 45

ImOn Arch Linux, I am trying to create a systemd service which runs a bash script here are the contents of the bashthis Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb
 

With some online guidance I then made a file named "myfirst.service"myfirst.service in /etc/systemd/system/etc/systemd/system to store the file for my service, here. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript/etc/startupjobscript, which is the bashBash script. afterAfter this i thenI enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesntdoesn't work and shows that it has failed to load and run at all.

Im trying to create a systemd service which runs a bash script here are the contents of the bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb
 

With some online guidance I then made a file named "myfirst.service" in /etc/systemd/system to store the file for my service, here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript which is the bash script. after this i then enabled and started the service with

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesnt work and shows that it has failed to load and run at all

On Arch Linux, I am trying to create a systemd service which runs this Bash script:

#!/bin/bash

/bin/xbindkeys &
/bin/setxkbmap -layout gb

With some online guidance I then made a file named myfirst.service in /etc/systemd/system to store my service. Here are the contents of the file:

[Unit]
Description=Command Service

[Service]
ExecStart=/etc/startupjobscript
User=user1
Type=oneshot
Restart=on-abort
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The service is supposed to execute /etc/startupjobscript, which is the Bash script. After this I enabled and started the service with:

systemctl enable myfirst
systemctl start myfirst

But for some reason it doesn't work and shows that it has failed to load and run at all.

Source Link
programmer
  • 1.1k
  • 7
  • 17
  • 35
Loading