LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-03-2014, 09:03 PM   #1
v3ct0r
Member
 
Registered: Jun 2013
Location: China
Distribution: Archlinux
Posts: 67

Rep: Reputation: Disabled
systemd startup script fails


Hey guys, recently I tried to run an simple on line script when booting up on my archlinux laptop. The script is
Code:
demsg -D
, and the .service file is looks like
Code:
[Unit]
Description=My script for disable error message in console

[Service]
ExecStart=/usr/bin/dmesg_D

[Install]
WantedBy=getty.target
I need this becasue my new laptop yoga2 keeps output an error message and I cannot fix it, as what Wiki does, use the script to disable the output. But somehow it fails to run, the error message is looks like
Code:
isable_print_message.service - My script for disable error message in console
   Loaded: loaded (/etc/systemd/system/disable_print_message.service; enabled)
   Active: failed (Result: exit-code) since Tue 2014-03-04 10:18:38 CST; 40min ago
  Process: 228 ExecStart=/usr/bin/dmesg_D (code=exited, status=203/EXEC)
 Main PID: 228 (code=exited, status=203/EXEC)
   CGroup: /system.slice/disable_print_message.service

Mar 04 10:18:38 localhost systemd[1]: Starting My script for disable error message in console...
Mar 04 10:18:38 localhost systemd[1]: Started My script for disable error message in console.
Mar 04 10:18:38 localhost systemd[1]: disable_print_message.service: main process exited, code=exited, status=203/EXEC
Mar 04 10:18:38 localhost systemd[1]: Unit disable_print_message.service entered failed state.
Truly I dont know why and I cant find any information here.
So guys, where am I wrong? Any helps? thanks verymuch
 
Old 03-03-2014, 09:30 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Well I guess my first question would be which example you provided has the correct command?

Example 1: demsg -D

Example 2: ExecStart=/usr/bin/dmesg_D

Now does the spelling matter or not?
 
Old 03-03-2014, 10:29 PM   #3
v3ct0r
Member
 
Registered: Jun 2013
Location: China
Distribution: Archlinux
Posts: 67

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
Well I guess my first question would be which example you provided has the correct command?

Example 1: demsg -D

Example 2: ExecStart=/usr/bin/dmesg_D

Now does the spelling matter or not?
er, actually not, the first demsg was truly a speeling error which I just typed in web browser, but the latter two "config details" were paste here, what is truly in /usr/bin/dmesg_D is
Code:
dmesg -D
.
Any ideas?
 
Old 03-03-2014, 11:37 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
So dmesg_D is a script? Are you able to show its contents?

I mean ultimately the message is very clear, something has attempted to execute and failed.
Does the following work:
Code:
$ /usr/bin/dmesg_D
And if so, what is its' exit code:
Code:
$ echo $?
 
Old 03-04-2014, 02:38 AM   #5
v3ct0r
Member
 
Registered: Jun 2013
Location: China
Distribution: Archlinux
Posts: 67

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
So dmesg_D is a script? Are you able to show its contents?

I mean ultimately the message is very clear, something has attempted to execute and failed.
Does the following work:
Code:
$ /usr/bin/dmesg_D
And if so, what is its' exit code:
Code:
$ echo $?
thanks for your help, but the dmesg_D script return 0, so the script is correct itself, which means that it was excuted at wrong time(lucky guess)?
 
Old 03-04-2014, 08:15 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Well the error message says that the script is erroring. So if it does not error on normal running then I would guess that something that it requires is not available.
Hence you would need to find out what it requires to be started and place the appropriate option in the Unit section, something like a Wants or After (maybe both)
 
  


Reply

Tags
systemd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert init script to systemd file service igor012 Linux - Software 1 10-15-2012 10:05 AM
systemd: replacing an init script for cpu scaling governors Meson Linux - Software 3 08-29-2012 01:24 PM
Running startup script fails because network share isn't ready (Perforce on Debian) tstein Linux - Software 1 05-21-2012 06:57 PM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM
My Linux Bash Script Fails to run when automated with OS Startup sanitynotvanity Linux - Software 5 06-16-2009 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration