Operation not permitted - can't remove empty /home/user/var/secondary-domain-dir

The directory is empty and is left over from a secondary domain created and later deleted in Siteworx. The site was just a testing ground and this remaining directory isn’t a problem except for its stubbornness. Any destructive command returns ‘Operation not permitted’ and I’m working on it as the root user.

Original permissions iworx:iworx 0711 changed a couple times between user:user and root:root while trying to find ways to release whatever prevents deletion of this directory. File permissions aren’t the problem and as far as I know, neither are attributes based on my limited knowledge of lsattr and chattr usage.

A potential clue I’ve found is an Interworx database file, a binary owned by iworx containing something about the secondary domain deleted in Siteworx…

/home/interworx/mysql/data/iworx/cmd_queue.MYD

This post may have relevance as my server is a KVM VPS. Is there a pex script method for cleaning up leftovers like I’ve described?

Thanks.

Hello–

The post you linked appears to be talking about an issue creating directories/accounts, not deleting them, so that would not be relevant, no.

You are unable to delete the directory because the var directory for SiteWorx accounts (/home/user/var) and its contents are immutable, by default, to prevent users from accidentally deleting essential files.

Example from my test server:

[root@alma-oct16 ~]# lsattr /home/testalma/
-----a-------------- /home/testalma/var
-------------------- /home/testalma/test.alma-oct16.jenna.iwx.io
lsattr: Operation not supported While reading flags on /home/testalma/public_html
[root@alma-oct16 ~]#

You can remove this setting with the following (obviously replacing ‘user’ with the unixuser):

chattr -R -a /home/user

That will allow you to delete the directory.

I would recommend putting the bit back after doing so by cd’ing into /home/user and running:

chattr +a var

There isn’t a script to clean up account leftovers, because it is very, very uncommon for there to be account leftovers. That generally indicates something odd happened during the deletion process, though it is not always possible to find that detail in logging.

If you do not feel comfortable doing this, or want us to take a look, directly, just submit a ticket to support.interworx.com, and make sure remote assistance is enabled.

Thanks,
-Jenna
Friendly Neighborhood InterWorx Support Manager

1 Like

So it was an attribute after all. I was literally barking up the wrong tree, plus for immutable I was expecting the i attribute.

chattr -R -a on the right directory allowed me to delete the leftover directory. I put the attribute back on /home/user/var.

Btw, other leftovers after deleting the site included dry run LE stuff in /etc/acmephp/certs/domain-dir and /etc/acmephp/var/domain-dir but no problem deleting there.

Thanks again!

1 Like

Hello–

You are correct that -i is for immutable. -a is append only, but it also has the same basic side effect that, since it can only be altered in append mode for writing, it also can’t be deleted, so I used ‘immutable’ as a shorthand. I could have been more specific. :slight_smile:

Glad that worked for you!

-Jenna