I wanted to change the ownership of a specific folder and I ended up hitting the enter unintentionally when typing, it crashed everything! apache mysql, ispconfig. help me please!! Code: root@server:~# service mysql start Job for mariadb.service failed because the control process exited with error cod e. See "systemctl status mariadb.service" and "journalctl -xe" for details.
Can you 'chown root:root /' now? If not you might have to but off another media, mount your root partition, then run chown.
Thanks for the reply Jesse Norell, I entered Rescue mode system offered by vps and mounted the partition, so I managed to redo the 'chown root: root /' command. But mysql doesn't run and neither does apache
Messing up ownership of files can cause big issues like this. Some folders have to be owned by Apache, some by ispconfig, etc. Do you have a backup that you can restore? If not, it will take quite some time to restore this correctly by comparing it with a working system...
Th0m, thanks for the reply, I tried to restart, I did everything I knew. a question: if i save the / var / lib / mysql folder with the database and copy it in a new installation, does it work?
Again, do you have a backup (snapshot) of the server that you can go back to? You could copy your files to a new installation but it is not a simple copy paste action.
No. The problem is the files have wrong owner and group owner. Copying them to a new installation does not change this. If you do not have backups you can restore, only way I can think of is compare with a working similar installation what owners and group owners files have and change accordingly. This is a lot of work. Restoring from backups is preferable.
Thanks for the reply Taleman, I managed to recover the sql files with the command chown -R mysql: mysql /var/lib/mysql + mv /var/lib/mysql/tc.log /var/lib/mysql/tc.log.bkp What was blocking mysql from starting was the log. Now I'm trying to start Apache
I would strongly advise you to do a full restore from a snapshot or reinstall as this can cause issues in the future.
a frequent accident and it can be problematic. It can be a good idea having a daily cron implementing some idea of the following thread. Some people mentions the metastore solution which was part of Debian, although now it seems outside the distro. Other people mentions acl. https://stackoverflow.com/questions...eate-a-script-to-save-and-restore-permissions also I have suffered this problem time ago, although still I have not implemented a cron task for this possibility. I must do it one of these days..
Is that solution for admins that do not make backups? Why not start backups from cron? If experimenting with changing permissions and owners is done often, consider a file system that support snapshots https://en.wikipedia.org/wiki/Snapshot_(computer_storage).
restoring a backup (from yesterday,etc) could change the users files and contents while a restore of permissions could preserve these. Although never tried, I will do one of these days.
more to the point, if experimenting with changing permissions and owners, have a test/staging copy of the live server and do the experiments there. never on a live server. and once you've got the required changes worked out, get the scripted, and then retest using the script. then load that script to the live server and run it. that should eliminate the risk of a fat-finger typo creeping in...