Article 5N2S2 Custom systemd unit service giving error - why?

Custom systemd unit service giving error - why?

by
ddenial
from LinuxQuestions.org on (#5N2S2)
Hello All

I have created a custom system unit service as follows. The function of this service is to run a particular command AFTER I log in to my user account.

Code:$ mkdir -p ~/.config/systemd/user

$ cd ~/.config/systemd/user

$ vim resizeit.service
[Unit]
Description=Run resize command

[Service]
ExecStart=/usr/bin/resize

[Install]
WantedBy=default.target

$ systemctl --user enable resizeit.service

$ sudo rebootBut, after reboot, the service is not running. It is giving the following error.

Code:$ systemctl --user status resizeit
* resizeit.service - Run resize command
Loaded: loaded (/home/danial/.config/systemd/user/resizeit.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2021-08-08 01:19:05 IST; 2min 20s ago
Process: 2069 ExecStart=/usr/bin/resize (code=exited, status=1/FAILURE)
Main PID: 2069 (code=exited, status=1/FAILURE)
CPU: 1ms

Aug 08 01:19:05 lab.kvm systemd[2059]: Started Run resize command.
Aug 08 01:19:05 lab.kvm systemd[2059]: resizeit.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 01:19:05 lab.kvm systemd[2059]: resizeit.service: Failed with result 'exit-code'.Can't figure it why?

Thankslatest?d=yIl2AUoC8zA latest?i=0E6OBOELz4o:stsZGpAGHt8:F7zBnMy latest?i=0E6OBOELz4o:stsZGpAGHt8:V_sGLiP latest?d=qj6IDK7rITs latest?i=0E6OBOELz4o:stsZGpAGHt8:gIN9vFw0E6OBOELz4o
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