Just wondering why some values of EnvironmentFile variable in the services files are as follows (output of grep):
/usr/lib/systemd/system/irda.service:EnvironmentFile=-/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysconfig/sshd
So, what's with the hyphen after = ??
What does it mean?
On 08/13/15 04:43, jd1008 wrote:
Just wondering why some values of EnvironmentFile variable in the services files are as follows (output of grep):
/usr/lib/systemd/system/irda.service:EnvironmentFile=-/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysconfig/sshd
So, what's with the hyphen after = ??
What does it mean?
The answer you seek is in the man pages.
On Thu, 2015-08-13 at 05:19 +0800, Ed Greshko wrote:
On 08/13/15 04:43, jd1008 wrote:
Just wondering why some values of EnvironmentFile variable in the services files are as follows (output of grep):
/usr/lib/systemd/system/irda.service:EnvironmentFile= -/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysconfig /sshd
So, what's with the hyphen after = ??
What does it mean?
The answer you seek is in the man pages.
-- If I wanted a blog or social media I'd go elsewhere
Actually I was intrigued by this (it's not standard Shell syntax) and had a quick look at the man pages. It certainly doesn't jump out at you. I looked at the pages for systemd-system.conf and systemd.service.
poc
On 08/13/15 05:34, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 05:19 +0800, Ed Greshko wrote:
On 08/13/15 04:43, jd1008 wrote:
Just wondering why some values of EnvironmentFile variable in the services files are as follows (output of grep):
/usr/lib/systemd/system/irda.service:EnvironmentFile= -/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysconfig /sshd
So, what's with the hyphen after = ??
What does it mean?
The answer you seek is in the man pages.
-- If I wanted a blog or social media I'd go elsewhere
Actually I was intrigued by this (it's not standard Shell syntax) and had a quick look at the man pages. It certainly doesn't jump out at you. I looked at the pages for systemd-system.conf and systemd.service.
Knowing that the man pages are also on the internet can be useful as it makes searching them much easier. Found the answer in one google search and another extra click. The extra click would not have been necessary had I picked the second of the returned search results. But I hadn't had my coffee yet so the apparent nature of the second result didn't register.
On Thu, 2015-08-13 at 05:40 +0800, Ed Greshko wrote:
On 08/13/15 05:34, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 05:19 +0800, Ed Greshko wrote:
On 08/13/15 04:43, jd1008 wrote:
Just wondering why some values of EnvironmentFile variable in the services files are as follows (output of grep):
/usr/lib/systemd/system/irda.service:EnvironmentFile= -/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysco nfig /sshd
So, what's with the hyphen after = ??
What does it mean?
The answer you seek is in the man pages.
-- If I wanted a blog or social media I'd go elsewhere
Actually I was intrigued by this (it's not standard Shell syntax) and had a quick look at the man pages. It certainly doesn't jump out at you. I looked at the pages for systemd-system.conf and systemd.service.
Knowing that the man pages are also on the internet can be useful as it makes searching them much easier. Found the answer in one google search and another extra click. The extra click would not have been necessary had I picked the second of the returned search results. But I hadn't had my coffee yet so the apparent nature of the second result didn't register.
If the man pages are clear it shouldn't be necessary to use a search engine to find essential information on basic system functionality. What if the info you're looking for relates to getting your net connection to work?
poc
On Wed, 2015-08-12 at 19:32 -0400, Tom Horsley wrote:
On Thu, 13 Aug 2015 00:26:55 +0100 Patrick O'Callaghan wrote:
What if the info you're looking for relates to getting your net connection to work?
That's what smart phones are for :-). (I've used mine more than once while trying to find out how to beat systemd into submission)
Unfortunately the fact that anything can be searched for seems to be an excuse for sloppy documentation, and sloppy documentation is often a symptom of sloppy thinking. If the developer can't explain what he did, does he actually understand it? In the Good Old Days (tm) one of the features that most distinguished Unix from its competitors was that the docs were all available within the system itself and were for the most part very clearly written.
poc
On 08/13/15 07:26, Patrick O'Callaghan wrote:
If the man pages are clear it shouldn't be necessary to use a search engine to find essential information on basic system functionality. What if the info you're looking for relates to getting your net connection to work?
I'm not interested in getting into a theoretical "what if" discussion of a vaguely defined issue. I'm not even sure I'd consult the man pages first with that issue. But, never mind.
The question was specific and given the volume of man pages (there are 158 systemd related man pages under /usr/share/man) I just find doing a search to be expedient. And, as I said, a 2 word google search and an extra click were all that was needed.
On Thu, 2015-08-13 at 07:46 +0800, Ed Greshko wrote:
On 08/13/15 07:26, Patrick O'Callaghan wrote:
If the man pages are clear it shouldn't be necessary to use a search engine to find essential information on basic system functionality. What if the info you're looking for relates to getting your net connection to work?
I'm not interested in getting into a theoretical "what if" discussion of a vaguely defined issue. I'm not even sure I'd consult the man pages first with that issue. But, never mind.
The question was specific and given the volume of man pages (there are 158 systemd related man pages under /usr/share/man) I just find doing a search to be expedient. And, as I said, a 2 word google search and an extra click were all that was needed.
That's just dandy if you happen to come up with the right two words.
poc
On 08/13/15 07:52, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 07:46 +0800, Ed Greshko wrote:
On 08/13/15 07:26, Patrick O'Callaghan wrote:
If the man pages are clear it shouldn't be necessary to use a search engine to find essential information on basic system functionality. What if the info you're looking for relates to getting your net connection to work?
I'm not interested in getting into a theoretical "what if" discussion of a vaguely defined issue. I'm not even sure I'd consult the man pages first with that issue. But, never mind.
The question was specific and given the volume of man pages (there are 158 systemd related man pages under /usr/share/man) I just find doing a search to be expedient. And, as I said, a 2 word google search and an extra click were all that was needed.
That's just dandy if you happen to come up with the right two words.
Being that it was a very specific question the 2 words were easy to divine.
On 08/13/15 08:01, Ed Greshko wrote:
Being that it was a very specific question the 2 words were easy to divine.
And, if I had my coffee, I probably would have used "-K" and a single word before resorting to google. Recalling, again, this to have been a very specific question with a very unique word.
On 13/08/15 01:42, Ed Greshko wrote:
On 08/13/15 08:01, Ed Greshko wrote:
Being that it was a very specific question the 2 words were easy to divine.
And, if I had my coffee, I probably would have used "-K" and a single word before resorting to google. Recalling, again, this to have been a very specific question with a very unique word.
I salute your google-fu! It is not at all obvious to me. The Question is what is the EnviromentFile and what does "=-" mean within it...
root@snoopy 08:46:58 ~ # apropos "=-" =-: nothing appropriate.
root@snoopy 08:47:06 ~ # apropos "EnvironmentFile" EnvironmentFile: nothing appropriate.
root@snoopy 08:50:12 ~ # apropos systemd | wc -l 155
Regards, Chris R.
On 08/13/15 15:52, Christopher Ross wrote:
On 13/08/15 01:42, Ed Greshko wrote:
On 08/13/15 08:01, Ed Greshko wrote:
Being that it was a very specific question the 2 words were easy to divine.
And, if I had my coffee, I probably would have used "-K" and a single word before resorting to google. Recalling, again, this to have been a very specific question with a very unique word.
I salute your google-fu! It is not at all obvious to me. The Question is what is the EnviromentFile and what does "=-" mean within it...
root@snoopy 08:46:58 ~ # apropos "=-" =-: nothing appropriate.
root@snoopy 08:47:06 ~ # apropos "EnvironmentFile" EnvironmentFile: nothing appropriate.
root@snoopy 08:50:12 ~ # apropos systemd | wc -l 155
You are using the wrong command. There is no "-K" in apropos.
On 13/08/15 08:52, Christopher Ross wrote:
On 13/08/15 01:42, Ed Greshko wrote:
On 08/13/15 08:01, Ed Greshko wrote:
Being that it was a very specific question the 2 words were easy to divine.
And, if I had my coffee, I probably would have used "-K" and a single word before resorting to google. Recalling, again, this to have been a very specific question with a very unique word.
I salute your google-fu! It is not at all obvious to me. The Question is what is the EnviromentFile and what does "=-" mean within it...
root@snoopy 08:46:58 ~ # apropos "=-" =-: nothing appropriate.
root@snoopy 08:47:06 ~ # apropos "EnvironmentFile" EnvironmentFile: nothing appropriate.
root@snoopy 08:50:12 ~ # apropos systemd | wc -l 155
Continuing that search then...
root@snoopy 08:50:25 ~ # apropos systemd | grep environment systemd-detect-virt (1) - Detect execution in a virtualized environment systemd.exec (5) - Execution environment configuration
root@snoopy 08:53:31 ~ # man systemd.exec
... EnvironmentFile= Similar to Environment= but reads the environment variables from a text file. The text file should contain new-line-separated variable assignments. Empty lines and lines starting with ; or # will be ignored, which may be used for commenting. A line ending with a backslash will be concatenated with the following one, allowing multiline variable definitions. The parser strips leading and trailing whitespace from the values of assignments, unless you use double quotes (").
So that's part of the question answered. The above manpage also says "See environ(7) for details about environment variables."
root@snoopy 09:07:33 ~ # man 7 environ
Unfortunately that man page makes no reference to "=-" or similar
root@snoopy 09:13:06 ~ # man bash
Neither does the bash manpage. So if your glib statement "The answer you seek is in the man pages." is true I cannot find it.
My guess is that the OP example
/usr/lib/systemd/system/irda.service:EnvironmentFile=-/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysconfig/sshd
In effect means "don't use that, use this" but I haven't confirmed that from the man page.
Regards, Chris R.
On 08/13/15 16:17, Christopher Ross wrote:
So if your glib statement "The answer you seek is in the man pages." is true I cannot find it.
man -K EnvironmentFile
takes you first directly to SYSTEMD.EXEC(5). Where you type /EnvironmentFile which brings you to the definition of EnvironmentFile= and includes the following in the second paragraph.
Konsole output The argument passed should be an absolute filename or wildcard expression, optionally prefixed with "-", which indicates that if the file does not exist, it will not be read and no error or warning message is logged. This option may be specified more than once in which case all specified files are read. If the empty string is assigned to this option, the list of file to read is reset, all prior assignments have no effect.
Which answer the question "So, what's with the hyphen after = ?? "
On Thu, 2015-08-13 at 16:30 +0800, Ed Greshko wrote:
On 08/13/15 16:17, Christopher Ross wrote:
So if your glib statement "The answer you seek is in the man pages." is true I cannot find it.
man -K EnvironmentFile
takes you first directly to SYSTEMD.EXEC(5). Where you type /EnvironmentFile which brings you to the definition of EnvironmentFile= and includes the following in the second paragraph.
Konsole output The argument passed should be an absolute filename or wildcard expression, optionally prefixed with "-", which indicates that if the file does not exist, it will not be read and no error or warning message is logged. This option may be specified more than once in which case all specified files are read. If the empty string is assigned to this option, the list of file to read is reset, all prior assignments have no effect.
Which answer the question "So, what's with the hyphen after = ?? "
Except that:
grep "=-" /usr/lib/systemd/*/*
throws up a whole bunch of of hits which don't include the word EnvironmentFile. IOW this syntax is not specific to that word, so the fact that you found it with "man -K EnvironmentFile" is merely a lucky guess. If you had done the above grep first, you most likely would not have thought of it (as I didn't).
I still await some identification of where the general rule is specified.
This is *not* good documentation.
poc
On 08/13/15 16:38, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 16:30 +0800, Ed Greshko wrote:
On 08/13/15 16:17, Christopher Ross wrote:
So if your glib statement "The answer you seek is in the man pages." is true I cannot find it.
man -K EnvironmentFile
takes you first directly to SYSTEMD.EXEC(5). Where you type /EnvironmentFile which brings you to the definition of EnvironmentFile= and includes the following in the second paragraph.
Konsole output The argument passed should be an absolute filename or wildcard expression, optionally prefixed with "-", which indicates that if the file does not exist, it will not be read and no error or warning message is logged. This option may be specified more than once in which case all specified files are read. If the empty string is assigned to this option, the list of file to read is reset, all prior assignments have no effect.
Which answer the question "So, what's with the hyphen after = ?? "
Except that:
grep "=-" /usr/lib/systemd/*/*
throws up a whole bunch of of hits which don't include the word EnvironmentFile. IOW this syntax is not specific to that word, so the fact that you found it with "man -K EnvironmentFile" is merely a lucky guess. If you had done the above grep first, you most likely would not have thought of it (as I didn't).
I still await some identification of where the general rule is specified.
This is *not* good documentation.
The question was... "So, what's with the hyphen after = ?? " in relationship to files in /usr/lib/systemd/system/irda.service containing EnvironmentFile= and 2 examples were given.
In order to answer the question I would not have used grep since there is no need to do that as the question was well worded and succinct.
If the answer given in the man page isn't sufficient for *your* needs then you need to ask another question.
And, FWIW, ....
grep "=-" /usr/lib/systemd/system/* | grep EnvironmentFile produces many entries such as...
/usr/lib/systemd/system/ypbind.service:EnvironmentFile=-/etc/sysconfig/network /usr/lib/systemd/system/ypbind.service:EnvironmentFile=-/etc/sysconfig/ypbind
On my system....so I'm not sure why you don't see that.
On 08/13/15 16:38, Patrick O'Callaghan wrote:
throws up a whole bunch of of hits which don't include the word EnvironmentFile.
Oh, I think I parsed your statement wrong. I should have read it as "more than EnvironmentFile contains that syntax such as ExecStartPre".
But that then results in a different question which can be answer in the same manner which results in finding the same man page and the following output....
ExecStartPre=, ExecStartPost= Additional commands that are executed before or after the command in ExecStart=, respectively. Syntax is the same as for ExecStart=, except that multiple command lines are allowed and the commands are executed one after the other, serially.
If any of those commands (not prefixed with "-") fail, the rest are not executed and the unit is considered failed.
On Thu, 2015-08-13 at 17:02 +0800, Ed Greshko wrote:
On 08/13/15 16:38, Patrick O'Callaghan wrote:
throws up a whole bunch of of hits which don't include the word EnvironmentFile.
Oh, I think I parsed your statement wrong. I should have read it as "more than EnvironmentFile contains that syntax such as ExecStartPre".
But that then results in a different question which can be answer in the same manner which results in finding the same man page and the following output....
ExecStartPre=, ExecStartPost= Additional commands that are executed before or after thecommand in ExecStart=, respectively. Syntax is the same as for ExecStart=, except that multiple command lines are allowed and the commands are executed one after the other, serially.
If any of those commands (not prefixed with "-") fail, therest are not executed and the unit is considered failed.
You can argue that if you like, but my point is that on seeing the examples the natural conclusion is that here is some new syntax I don't know about, so let me look in the systemd docs for some explanation. The fact that it's only documented in specific examples makes it much harder to find. I don't expect the syntax of environment variable assignments to be explained every time one of them shows up in a man page.
poc
On 08/13/15 18:17, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 17:02 +0800, Ed Greshko wrote:
On 08/13/15 16:38, Patrick O'Callaghan wrote:
throws up a whole bunch of of hits which don't include the word EnvironmentFile.
Oh, I think I parsed your statement wrong. I should have read it as "more than EnvironmentFile contains that syntax such as ExecStartPre".
But that then results in a different question which can be answer in the same manner which results in finding the same man page and the following output....
ExecStartPre=, ExecStartPost= Additional commands that are executed before or after thecommand in ExecStart=, respectively. Syntax is the same as for ExecStart=, except that multiple command lines are allowed and the commands are executed one after the other, serially.
If any of those commands (not prefixed with "-") fail, therest are not executed and the unit is considered failed.
You can argue that if you like, but my point is that on seeing the examples the natural conclusion is that here is some new syntax I don't know about, so let me look in the systemd docs for some explanation. The fact that it's only documented in specific examples makes it much harder to find. I don't expect the syntax of environment variable assignments to be explained every time one of them shows up in a man page.
I'm not arguing, I'm making statements. And, BTW, as I said I think the usage of "-" is context dependent. Have a look at "man systemd.slice". So it seems the question "what is the general meaning of -" may be an invalid question.
The only point I'm making is, the answer to the original question seems easy to come by if one just makes the effort. Nothing more, nothing less.
On Thu, 2015-08-13 at 18:24 +0800, Ed Greshko wrote:
On 08/13/15 18:17, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 17:02 +0800, Ed Greshko wrote:
On 08/13/15 16:38, Patrick O'Callaghan wrote:
throws up a whole bunch of of hits which don't include the word EnvironmentFile.
Oh, I think I parsed your statement wrong. I should have read it as "more than EnvironmentFile contains that syntax such as ExecStartPre".
But that then results in a different question which can be answer in the same manner which results in finding the same man page and the following output....
ExecStartPre=, ExecStartPost= Additional commands that are executed before or afterthe command in ExecStart=, respectively. Syntax is the same as for ExecStart=, except that multiple command lines are allowed and the commands are executed one after the other, serially.
If any of those commands (not prefixed with "-") fail,the rest are not executed and the unit is considered failed.
You can argue that if you like, but my point is that on seeing the examples the natural conclusion is that here is some new syntax I don't know about, so let me look in the systemd docs for some explanation. The fact that it's only documented in specific examples makes it much harder to find. I don't expect the syntax of environment variable assignments to be explained every time one of them shows up in a man page.
I'm not arguing, I'm making statements. And, BTW, as I said I think the usage of "-" is context dependent. Have a look at "man systemd.slice". So it seems the question "what is the general meaning of -" may be an invalid question.
The only point I'm making is, the answer to the original question seems easy to come by if one just makes the effort. Nothing more, nothing less.
And my point is that it depends. I did make a considerable effort without finding this and I'm not a newbie at this stuff. Maybe if you had just given the straight dope instead of insisting it was easy to find we wouldn't be having this discussion.
I propose to leave it at that.
poc
On 08/13/2015 06:15 AM, Patrick O'Callaghan wrote:
Maybe if you had just given the straight dope instead of insisting it was easy to find we wouldn't be having this discussion.
+1
On 08/13/15 19:15, Patrick O'Callaghan wrote:
Maybe if you had just given the straight dope instead of insisting it was easy to find we wouldn't be having this discussion.
I suppose so. Yet one hopes that at least one person could learn a few more commands/methods of doing research from this thread. You know what they say about giving fish v.s. teaching fishing. I guess all some people want are the fish.
On Thu, 2015-08-13 at 20:11 +0800, Ed Greshko wrote:
On 08/13/15 19:15, Patrick O'Callaghan wrote:
Maybe if you had just given the straight dope instead of insisting it was easy to find we wouldn't be having this discussion.
I suppose so. Yet one hopes that at least one person could learn a few more commands/methods of doing research from this thread. You know what they say about giving fish v.s. teaching fishing. I guess all some people want are the fish.
Or you can give the fish and teach the fishing.
That's enough of this.
poc
On 13/08/15 11:17, Patrick O'Callaghan wrote:
On Thu, 2015-08-13 at 17:02 +0800, Ed Greshko wrote:
On 08/13/15 16:38, Patrick O'Callaghan wrote:
throws up a whole bunch of of hits which don't include the word EnvironmentFile.
Oh, I think I parsed your statement wrong. I should have read it as "more than EnvironmentFile contains that syntax such as ExecStartPre".
But that then results in a different question which can be answer in the same manner which results in finding the same man page and the following output....
ExecStartPre=, ExecStartPost= Additional commands that are executed before or after thecommand in ExecStart=, respectively. Syntax is the same as for ExecStart=, except that multiple command lines are allowed and the commands are executed one after the other, serially.
If any of those commands (not prefixed with "-") fail, therest are not executed and the unit is considered failed.
You can argue that if you like, but my point is that on seeing the examples the natural conclusion is that here is some new syntax I don't know about, so let me look in the systemd docs for some explanation. The fact that it's only documented in specific examples makes it much harder to find. I don't expect the syntax of environment variable assignments to be explained every time one of them shows up in a man page.
poc
Well I found it, I just didn't quote that bit. So Ed was right.
Regards, Chris R.
On 08/13/15 16:38, Patrick O'Callaghan wrote:
I still await some identification of where the general rule is specified.
Maybe you will wait forever on that question, which wasn't asked until now. And which I missed as the *not* in the next sentence shows as bold in T-Bird and it drew my eyes away.
I say I think you will wait forever since it is very possible that particular question is not addressed in documentation as it very well may be specific to the context in which it is being used. Which could be why in the 2 parameters using it the man page describes the meaning for each.
But, this is getting off topic. The original question was asked/answered and now I think this is being taken into the realm of "the documentation is not good" which, as shown in the past, just leads to an unproductive discussion.
Do the rest of us on this list have to read this stupid thread?
Sent from my iPhone
On 13 Aug 2015, at 01:42, Ed Greshko ed.greshko@greshko.com wrote:
On 08/13/15 08:01, Ed Greshko wrote: Being that it was a very specific question the 2 words were easy to divine.
And, if I had my coffee, I probably would have used "-K" and a single word before resorting to google. Recalling, again, this to have been a very specific question with a very unique word.
-- If I wanted a blog or social media I'd go elsewhere -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
On Wed, Aug 12, 2015 at 4:43 PM, jd1008 jd1008@gmail.com wrote:
Just wondering why some values of EnvironmentFile variable in the services files are as follows (output of grep):
/usr/lib/systemd/system/irda.service:EnvironmentFile=-/etc/sysconfig/irda /usr/lib/systemd/system/sshd.service:EnvironmentFile=/etc/sysconfig/sshd
So, what's with the hyphen after = ??
What does it mean?
If the file doesn't exist, it's not read.