LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-29-2018, 04:52 AM   #1
tankzeu
LQ Newbie
 
Registered: Sep 2018
Posts: 26

Rep: Reputation: Disabled
Systemd service trims script directory


I have in my test123.service file the following line for ExecStart :
"ExecStart=/home/test/Documents/s (there are 5 spaces here) s/s (there are 10 spaces here) ssss/bin/test123.sh start systemd",which is correct .However when I start the service I get the following error :

" Process: 2864 ExecStart=/home/test/Documents/s s/s ssss/bin/test123.sh start systemd (code=exited, status=203/EXEC)" .It seems that the folders are trimmed and that is why it fails.Any suggestions how can I fix this?

Last edited by tankzeu; 10-29-2018 at 04:57 AM.
 
Old 10-29-2018, 06:49 AM   #2
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Rep: Reputation: 61
It is because you have spaces in the directory structure and have not escaped them. I would remove the spaces. Also would not recommend putting a system start script under /home.
 
Old 10-29-2018, 09:06 AM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,738

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
If you put your code in [code] tags when posting here, the spaces will be preserved.
As stated, you'll need to escape the spaces, although why you've created directory names with spaces in them is a mystery.
 
Old 10-31-2018, 03:01 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by tankzeu View Post
I have in my test123.service file the following line for ExecStart :
"ExecStart=/home/test/Documents/s (there are 5 spaces here) s/s (there are 10 spaces here) ssss/bin/test123.sh start systemd",which is correct .However when I start the service I get the following error :

" Process: 2864 ExecStart=/home/test/Documents/s s/s ssss/bin/test123.sh start systemd (code=exited, status=203/EXEC)" .It seems that the folders are trimmed and that is why it fails.Any suggestions how can I fix this?
so basically you are testing "how can i make systemd fail".
it seems you succeeded.
as far as my experience with systemd, it really likes to adhere to the time-honored tradition of not putting spaces in filenames.

i don't know why you don't use code tags (they preserve formatting) but it looks like all subsequent spaces got concatenated into 1.
you could try escaping each space like this:
Code:
ExecStart=/home/test/Documents/s\ \ \ \ \ sss/..etc.......
and i'm pretty sure the first " (doublequote) belongs AFTER ExecStart=, not before it.
 
  


Reply



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
Systemd service file directory tankzeu Linux - Newbie 7 09-20-2018 09:09 PM
[SOLVED] systemd service type for running a shell script containing a pipe genogebot Linux - Server 4 06-17-2016 08:42 PM
Can't access full journalctl from script via systemd service even though user is in systemd-journal group iwtbf Linux - Newbie 0 02-19-2016 02:44 PM
Convert init script to systemd file service igor012 Linux - Software 1 10-15-2012 10:05 AM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM

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

All times are GMT -5. The time now is 11:56 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