You are not logged in.

#1 2017-04-03 21:18:32

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

On my system, /srv/http is a symlink (http -> mnt/http), not a directory.
I got an error during package upgrade:

upgraded libutil-linux (2.29.2-1 -> 2.29.2-2)
error: cannot remove /srv/http/ (Not a directory)

The symlink was deleted and an empty http directory created.
I reverted this manually, http seems to work again.

Would i have to manually repair other things because of broken upgrade?

Offline

#2 2017-04-03 22:24:29

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Not likely... pacman changes a while back makes it hate symlinks as I recall.  You're probably fine.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2017-04-08 15:56:09

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

You'll have to do this every time. Or fix your broken setup (use mount/bind mount instead of symlinks).

Offline

#4 2017-04-30 01:19:12

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Thanks! Changed my setup to bind mounts.

(Btw, is there something wrong with using symlinks? - I mean they are widely-used in the system, e.g. /bin -> /usr/bin, /lib[64] -> /usr/lib ... )

Offline

#5 2017-04-30 01:39:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

There is nothing wrong with symlinks.  There is something wrong with replacing files and directories owned by core packages.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2017-04-30 01:56:53

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Trilby wrote:

There is nothing wrong with symlinks.  There is something wrong with replacing files and directories owned by core packages.

... but the /srv/http directory is not owned by the libutil-linux package, nor the apache package?

Offline

#7 2017-04-30 02:48:50

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Quotation from /etc/httpd/conf/httpd.conf :

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/http"
<Directory "/srv/http">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

... so /srv/http is typically a pure data directory, which can contain symlinks.
So should pacman replace such a symlink on its own?

Offline

#8 2017-04-30 03:20:58

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

% pacman -Qo /srv/http
/srv/http/ is owned by filesystem 2017.03-2

Offline

#9 2017-04-30 04:11:13

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Scimmia wrote:
pacman -Qo

Thanks, i missed this pacman option ...

But the question remains - should /srv/http be forced to be a directory, although apache allows a symlink?
Or is it considered to be bad style to use a symlink for the DocumentRoot?
(Should this directory entry be preinstalled at all? I think, apache is not necessarily installed on a system?)

Offline

#10 2017-04-30 08:24:54

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

/srv/http isn't limited to apache only, other webservers can use it too.

Though, according to FHS, there isn't any standard about the subdirectories of /srv: http://refspecs.linuxfoundation.org/FHS … 03s17.html

Offline

#11 2017-04-30 10:36:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Also apache is fine with document root being a directory or a symlink to a directory.  That really says nothing about /srv/http as apache is fine with the document root being /srv/http or /var/http or /mnt/http (why not just do this for your case) or damn near anywhere else.  Apache doesn't decide where your document root needs to be - you just need to tell it where it is so it can serve those files.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2017-05-01 02:04:35

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

x33a wrote:

/srv/http isn't limited to apache only, other webservers can use it too.

... but still, why should it be preinstalled and enforced to be a directory, instead of being installed by each individual webserver package, only if needed?

x33a wrote:

Though, according to FHS, there isn't any standard about the subdirectories of /srv: http://refspecs.linuxfoundation.org/FHS … 03s17.html

And it says also:

Distributions must take care not to remove locally placed files in these directories without administrator permission. [20]
---
[20] This is particularly important as these areas will often contain both files initially installed by the distributor, and those added by the administrator.

Although, of course, removing a user created symlink is nothing like overwriting an existing config file containing complex changes or deleting valuable data, this is still a bit counterintuitive.

(Pacman could check, if the symlink points to a valid directory, and then leave it, maybe showing a warning? Then to get rid of the warning, one could choose an alternative configuration.)

Offline

#13 2017-05-01 02:06:04

Bernd Michaely
Member
Registered: 2015-02-08
Posts: 12

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Trilby wrote:

Also apache is fine with document root being a directory or a symlink to a directory.  That really says nothing about /srv/http as apache is fine with the document root being /srv/http or /var/http or /mnt/http (why not just do this for your case) or damn near anywhere else.  Apache doesn't decide where your document root needs to be - you just need to tell it where it is so it can serve those files.

Of course, the document root is configurable, but it seems to be an unexpected and unneccessary restriction for configuration (which seems to me to be a bit of a contradiction to the archlinux philosophy, trying to be clean and close to the original software?).

(The original error occured just because i simply didn't expect a symlink to cause a problem, thinking the /srv/http directory was created through the first run of httpd or something like that, and not being a fixed part of a core package.)

(Btw i changed my config (again) to use /mnt/http as document root, it works fine now, thanks! :-)

Offline

#14 2017-05-01 06:31:08

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: upgraded libutil-linux --> error: cannot remove /srv/http/ (Not a dir)

Bernd Michaely wrote:
x33a wrote:

/srv/http isn't limited to apache only, other webservers can use it too.

... but still, why should it be preinstalled and enforced to be a directory, instead of being installed by each individual webserver package, only if needed?

Because, in that case the different webserver packages will have to conflict with each other, which isn't the case right now.

Offline

Board footer

Powered by FluxBB