Where to put daemon files?
I wrote a couple daemons communicating over Unix domain sockets (raw sockets) and now I want to find the most suitable location for them on the production server. Where to put which files?
Here's what I got so far (feel free to suggest better locations):
Daemon binaries/executables: no clue.../usr/sbin/<subdir>/?/usr/bin/<subdir>/? Somewhere else?
Sockets:/var/run/<subdir>/(no idea why but I wouldn't feel comfortable with/tmp/)
Log files:/var/log/<subdir>/
Configuration files:/etc/<subdir>/
The target OS is Ubuntu server 16.04+.
filesystems daemon
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I wrote a couple daemons communicating over Unix domain sockets (raw sockets) and now I want to find the most suitable location for them on the production server. Where to put which files?
Here's what I got so far (feel free to suggest better locations):
Daemon binaries/executables: no clue.../usr/sbin/<subdir>/?/usr/bin/<subdir>/? Somewhere else?
Sockets:/var/run/<subdir>/(no idea why but I wouldn't feel comfortable with/tmp/)
Log files:/var/log/<subdir>/
Configuration files:/etc/<subdir>/
The target OS is Ubuntu server 16.04+.
filesystems daemon
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I wrote a couple daemons communicating over Unix domain sockets (raw sockets) and now I want to find the most suitable location for them on the production server. Where to put which files?
Here's what I got so far (feel free to suggest better locations):
Daemon binaries/executables: no clue.../usr/sbin/<subdir>/?/usr/bin/<subdir>/? Somewhere else?
Sockets:/var/run/<subdir>/(no idea why but I wouldn't feel comfortable with/tmp/)
Log files:/var/log/<subdir>/
Configuration files:/etc/<subdir>/
The target OS is Ubuntu server 16.04+.
filesystems daemon
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I wrote a couple daemons communicating over Unix domain sockets (raw sockets) and now I want to find the most suitable location for them on the production server. Where to put which files?
Here's what I got so far (feel free to suggest better locations):
Daemon binaries/executables: no clue.../usr/sbin/<subdir>/?/usr/bin/<subdir>/? Somewhere else?
Sockets:/var/run/<subdir>/(no idea why but I wouldn't feel comfortable with/tmp/)
Log files:/var/log/<subdir>/
Configuration files:/etc/<subdir>/
The target OS is Ubuntu server 16.04+.
filesystems daemon
filesystems daemon
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 3 hours ago
Sceptical JuleSceptical Jule
101
101
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Sceptical Jule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
When in doubt about Linux File System usage, consult the Filesystem Hierarchy Standard.
- If the daemons are local to your server only:
/usr/local/bin/
- Sockets: Correct
- log files: Correct
- Config files: Correct
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
add a comment |
There are many fine resources on the standards, including https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
I would suggest:
Sockets:/run/<subdir>/. That's because/var/runis just a sym-link to/runthese days on Ubuntu./runis the newer standard place for such things.
Log files:/var/log/<subdir>/Correct. Although a single log doesn't actually need a directory. Don't forget to add an/etc/logrotate.dentry as well
Configuration files:/etc/<subdir>/Correct. Again a single config file doesn't need a directory but it doesn't hurt.
The binaries:
These are tricky there's a whole bunch of places they can exist. Generally bin is for user commands, sbin is for server daemons. Some people say sbin is for binaries executed only by root. See here: https://askubuntu.com/questions/308045/differences-between-bin-sbin-usr-bin-usr-sbin-usr-local-bin-usr-local
- Do NOT use
/binor/sbin. Reserve these for binaries required to boot your system. - Do use
/usr/binand/usr/sbin. Most things on unbuntu live here although there are exceptions. If you are properly packaging your software (into a .dpkg or similar) then definitely use/usr/binand/usr/sbin. - If you don't intend to package it properly and just want to manually copy it as a sys admin then
/usr/local/binand/usr/local/sbinare more appropriate. But this generally shouldn't be used if you are going to distribute your code to other people. - If some of your binaries are only ever used by your other binaries, consider putting them under
/usr/libor/usr/local/lib. It's not uncommon for binaries to be thought of as libraries
In short, /usr/sbin and /usr/bin` were most likely correct.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sceptical Jule is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493342%2fwhere-to-put-daemon-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
When in doubt about Linux File System usage, consult the Filesystem Hierarchy Standard.
- If the daemons are local to your server only:
/usr/local/bin/
- Sockets: Correct
- log files: Correct
- Config files: Correct
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
add a comment |
When in doubt about Linux File System usage, consult the Filesystem Hierarchy Standard.
- If the daemons are local to your server only:
/usr/local/bin/
- Sockets: Correct
- log files: Correct
- Config files: Correct
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
add a comment |
When in doubt about Linux File System usage, consult the Filesystem Hierarchy Standard.
- If the daemons are local to your server only:
/usr/local/bin/
- Sockets: Correct
- log files: Correct
- Config files: Correct
When in doubt about Linux File System usage, consult the Filesystem Hierarchy Standard.
- If the daemons are local to your server only:
/usr/local/bin/
- Sockets: Correct
- log files: Correct
- Config files: Correct
edited 1 hour ago
answered 3 hours ago
FabbyFabby
3,76611228
3,76611228
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
add a comment |
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
This is a developer writing custom software. Edited for clarity. @couling
– Fabby
2 hours ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
The more I read this the more this answer is feels broken.
– couling
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
Please post your own answer then and I'l delete mine if it's better. @couling Revision rolled back to original.
– Fabby
1 hour ago
add a comment |
There are many fine resources on the standards, including https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
I would suggest:
Sockets:/run/<subdir>/. That's because/var/runis just a sym-link to/runthese days on Ubuntu./runis the newer standard place for such things.
Log files:/var/log/<subdir>/Correct. Although a single log doesn't actually need a directory. Don't forget to add an/etc/logrotate.dentry as well
Configuration files:/etc/<subdir>/Correct. Again a single config file doesn't need a directory but it doesn't hurt.
The binaries:
These are tricky there's a whole bunch of places they can exist. Generally bin is for user commands, sbin is for server daemons. Some people say sbin is for binaries executed only by root. See here: https://askubuntu.com/questions/308045/differences-between-bin-sbin-usr-bin-usr-sbin-usr-local-bin-usr-local
- Do NOT use
/binor/sbin. Reserve these for binaries required to boot your system. - Do use
/usr/binand/usr/sbin. Most things on unbuntu live here although there are exceptions. If you are properly packaging your software (into a .dpkg or similar) then definitely use/usr/binand/usr/sbin. - If you don't intend to package it properly and just want to manually copy it as a sys admin then
/usr/local/binand/usr/local/sbinare more appropriate. But this generally shouldn't be used if you are going to distribute your code to other people. - If some of your binaries are only ever used by your other binaries, consider putting them under
/usr/libor/usr/local/lib. It's not uncommon for binaries to be thought of as libraries
In short, /usr/sbin and /usr/bin` were most likely correct.
add a comment |
There are many fine resources on the standards, including https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
I would suggest:
Sockets:/run/<subdir>/. That's because/var/runis just a sym-link to/runthese days on Ubuntu./runis the newer standard place for such things.
Log files:/var/log/<subdir>/Correct. Although a single log doesn't actually need a directory. Don't forget to add an/etc/logrotate.dentry as well
Configuration files:/etc/<subdir>/Correct. Again a single config file doesn't need a directory but it doesn't hurt.
The binaries:
These are tricky there's a whole bunch of places they can exist. Generally bin is for user commands, sbin is for server daemons. Some people say sbin is for binaries executed only by root. See here: https://askubuntu.com/questions/308045/differences-between-bin-sbin-usr-bin-usr-sbin-usr-local-bin-usr-local
- Do NOT use
/binor/sbin. Reserve these for binaries required to boot your system. - Do use
/usr/binand/usr/sbin. Most things on unbuntu live here although there are exceptions. If you are properly packaging your software (into a .dpkg or similar) then definitely use/usr/binand/usr/sbin. - If you don't intend to package it properly and just want to manually copy it as a sys admin then
/usr/local/binand/usr/local/sbinare more appropriate. But this generally shouldn't be used if you are going to distribute your code to other people. - If some of your binaries are only ever used by your other binaries, consider putting them under
/usr/libor/usr/local/lib. It's not uncommon for binaries to be thought of as libraries
In short, /usr/sbin and /usr/bin` were most likely correct.
add a comment |
There are many fine resources on the standards, including https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
I would suggest:
Sockets:/run/<subdir>/. That's because/var/runis just a sym-link to/runthese days on Ubuntu./runis the newer standard place for such things.
Log files:/var/log/<subdir>/Correct. Although a single log doesn't actually need a directory. Don't forget to add an/etc/logrotate.dentry as well
Configuration files:/etc/<subdir>/Correct. Again a single config file doesn't need a directory but it doesn't hurt.
The binaries:
These are tricky there's a whole bunch of places they can exist. Generally bin is for user commands, sbin is for server daemons. Some people say sbin is for binaries executed only by root. See here: https://askubuntu.com/questions/308045/differences-between-bin-sbin-usr-bin-usr-sbin-usr-local-bin-usr-local
- Do NOT use
/binor/sbin. Reserve these for binaries required to boot your system. - Do use
/usr/binand/usr/sbin. Most things on unbuntu live here although there are exceptions. If you are properly packaging your software (into a .dpkg or similar) then definitely use/usr/binand/usr/sbin. - If you don't intend to package it properly and just want to manually copy it as a sys admin then
/usr/local/binand/usr/local/sbinare more appropriate. But this generally shouldn't be used if you are going to distribute your code to other people. - If some of your binaries are only ever used by your other binaries, consider putting them under
/usr/libor/usr/local/lib. It's not uncommon for binaries to be thought of as libraries
In short, /usr/sbin and /usr/bin` were most likely correct.
There are many fine resources on the standards, including https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
I would suggest:
Sockets:/run/<subdir>/. That's because/var/runis just a sym-link to/runthese days on Ubuntu./runis the newer standard place for such things.
Log files:/var/log/<subdir>/Correct. Although a single log doesn't actually need a directory. Don't forget to add an/etc/logrotate.dentry as well
Configuration files:/etc/<subdir>/Correct. Again a single config file doesn't need a directory but it doesn't hurt.
The binaries:
These are tricky there's a whole bunch of places they can exist. Generally bin is for user commands, sbin is for server daemons. Some people say sbin is for binaries executed only by root. See here: https://askubuntu.com/questions/308045/differences-between-bin-sbin-usr-bin-usr-sbin-usr-local-bin-usr-local
- Do NOT use
/binor/sbin. Reserve these for binaries required to boot your system. - Do use
/usr/binand/usr/sbin. Most things on unbuntu live here although there are exceptions. If you are properly packaging your software (into a .dpkg or similar) then definitely use/usr/binand/usr/sbin. - If you don't intend to package it properly and just want to manually copy it as a sys admin then
/usr/local/binand/usr/local/sbinare more appropriate. But this generally shouldn't be used if you are going to distribute your code to other people. - If some of your binaries are only ever used by your other binaries, consider putting them under
/usr/libor/usr/local/lib. It's not uncommon for binaries to be thought of as libraries
In short, /usr/sbin and /usr/bin` were most likely correct.
answered 1 hour ago
coulingcouling
267210
267210
add a comment |
add a comment |
Sceptical Jule is a new contributor. Be nice, and check out our Code of Conduct.
Sceptical Jule is a new contributor. Be nice, and check out our Code of Conduct.
Sceptical Jule is a new contributor. Be nice, and check out our Code of Conduct.
Sceptical Jule is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493342%2fwhere-to-put-daemon-files%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown