NFS Mounting from apache2 php worked as expected under Ubuntu 16 but not Ubuntu 18.04
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have php code for apache2 that is supposed to mount NFS filesystems on the server. They have the form of exec("some scripts that do the mount that has the correct sudo permissions");
This worked fine and as expected on ubuntu 16. After mounting I could do a 'df' and the mounted volume would appear and I could access it as expected.
Under ubuntu 18, the behavior is different and I don't understand it. It seems to do a virtual or temporary mount but nobody but www-data user can access it. In other words, I do php
exec("mount script");
exec("df > some_log_file");
and some_log_file will show the mount. But if at the same time I log into the server, either directly on the display or via ssh, and I type 'df' it does NOT appear (nor is it accessible in any other way even as root).
I'm guessing this might have something to do with systemd since it's sort of like the PrivateTmp thing, but I can't even figure out what string to type into google to figure out what's going on.
Note: this is an apache server that is on an isolated LAN NOT connected to the Internet so there is no security risk so you needn't point the riskiness out.
18.04 mount apache2 php nfs
add a comment |
I have php code for apache2 that is supposed to mount NFS filesystems on the server. They have the form of exec("some scripts that do the mount that has the correct sudo permissions");
This worked fine and as expected on ubuntu 16. After mounting I could do a 'df' and the mounted volume would appear and I could access it as expected.
Under ubuntu 18, the behavior is different and I don't understand it. It seems to do a virtual or temporary mount but nobody but www-data user can access it. In other words, I do php
exec("mount script");
exec("df > some_log_file");
and some_log_file will show the mount. But if at the same time I log into the server, either directly on the display or via ssh, and I type 'df' it does NOT appear (nor is it accessible in any other way even as root).
I'm guessing this might have something to do with systemd since it's sort of like the PrivateTmp thing, but I can't even figure out what string to type into google to figure out what's going on.
Note: this is an apache server that is on an isolated LAN NOT connected to the Internet so there is no security risk so you needn't point the riskiness out.
18.04 mount apache2 php nfs
How about; en.wikipedia.org/wiki/Filesystem_in_Userspace
– Pasi Suominen
Apr 6 at 22:16
Hello, as workaround, if the mountpoint is inside/tmp, try with different mountpoint outside.. I think your assumption this might have something to do with systemd since it's sort of like the PrivateTmp thing is right.
– pa4080
Apr 8 at 9:15
The mount point wasn't in /tmp but I'll try mounting other places.
– Bret Wallach
Apr 8 at 22:29
add a comment |
I have php code for apache2 that is supposed to mount NFS filesystems on the server. They have the form of exec("some scripts that do the mount that has the correct sudo permissions");
This worked fine and as expected on ubuntu 16. After mounting I could do a 'df' and the mounted volume would appear and I could access it as expected.
Under ubuntu 18, the behavior is different and I don't understand it. It seems to do a virtual or temporary mount but nobody but www-data user can access it. In other words, I do php
exec("mount script");
exec("df > some_log_file");
and some_log_file will show the mount. But if at the same time I log into the server, either directly on the display or via ssh, and I type 'df' it does NOT appear (nor is it accessible in any other way even as root).
I'm guessing this might have something to do with systemd since it's sort of like the PrivateTmp thing, but I can't even figure out what string to type into google to figure out what's going on.
Note: this is an apache server that is on an isolated LAN NOT connected to the Internet so there is no security risk so you needn't point the riskiness out.
18.04 mount apache2 php nfs
I have php code for apache2 that is supposed to mount NFS filesystems on the server. They have the form of exec("some scripts that do the mount that has the correct sudo permissions");
This worked fine and as expected on ubuntu 16. After mounting I could do a 'df' and the mounted volume would appear and I could access it as expected.
Under ubuntu 18, the behavior is different and I don't understand it. It seems to do a virtual or temporary mount but nobody but www-data user can access it. In other words, I do php
exec("mount script");
exec("df > some_log_file");
and some_log_file will show the mount. But if at the same time I log into the server, either directly on the display or via ssh, and I type 'df' it does NOT appear (nor is it accessible in any other way even as root).
I'm guessing this might have something to do with systemd since it's sort of like the PrivateTmp thing, but I can't even figure out what string to type into google to figure out what's going on.
Note: this is an apache server that is on an isolated LAN NOT connected to the Internet so there is no security risk so you needn't point the riskiness out.
18.04 mount apache2 php nfs
18.04 mount apache2 php nfs
asked Apr 6 at 21:47
Bret WallachBret Wallach
163
163
How about; en.wikipedia.org/wiki/Filesystem_in_Userspace
– Pasi Suominen
Apr 6 at 22:16
Hello, as workaround, if the mountpoint is inside/tmp, try with different mountpoint outside.. I think your assumption this might have something to do with systemd since it's sort of like the PrivateTmp thing is right.
– pa4080
Apr 8 at 9:15
The mount point wasn't in /tmp but I'll try mounting other places.
– Bret Wallach
Apr 8 at 22:29
add a comment |
How about; en.wikipedia.org/wiki/Filesystem_in_Userspace
– Pasi Suominen
Apr 6 at 22:16
Hello, as workaround, if the mountpoint is inside/tmp, try with different mountpoint outside.. I think your assumption this might have something to do with systemd since it's sort of like the PrivateTmp thing is right.
– pa4080
Apr 8 at 9:15
The mount point wasn't in /tmp but I'll try mounting other places.
– Bret Wallach
Apr 8 at 22:29
How about; en.wikipedia.org/wiki/Filesystem_in_Userspace
– Pasi Suominen
Apr 6 at 22:16
How about; en.wikipedia.org/wiki/Filesystem_in_Userspace
– Pasi Suominen
Apr 6 at 22:16
Hello, as workaround, if the mountpoint is inside
/tmp, try with different mountpoint outside.. I think your assumption this might have something to do with systemd since it's sort of like the PrivateTmp thing is right.– pa4080
Apr 8 at 9:15
Hello, as workaround, if the mountpoint is inside
/tmp, try with different mountpoint outside.. I think your assumption this might have something to do with systemd since it's sort of like the PrivateTmp thing is right.– pa4080
Apr 8 at 9:15
The mount point wasn't in /tmp but I'll try mounting other places.
– Bret Wallach
Apr 8 at 22:29
The mount point wasn't in /tmp but I'll try mounting other places.
– Bret Wallach
Apr 8 at 22:29
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});
}
});
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%2faskubuntu.com%2fquestions%2f1131753%2fnfs-mounting-from-apache2-php-worked-as-expected-under-ubuntu-16-but-not-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1131753%2fnfs-mounting-from-apache2-php-worked-as-expected-under-ubuntu-16-but-not-ubuntu%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
How about; en.wikipedia.org/wiki/Filesystem_in_Userspace
– Pasi Suominen
Apr 6 at 22:16
Hello, as workaround, if the mountpoint is inside
/tmp, try with different mountpoint outside.. I think your assumption this might have something to do with systemd since it's sort of like the PrivateTmp thing is right.– pa4080
Apr 8 at 9:15
The mount point wasn't in /tmp but I'll try mounting other places.
– Bret Wallach
Apr 8 at 22:29