Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your personal settings will not be saved #3959

Closed
720720 opened this issue Apr 16, 2017 · 6 comments
Closed

Your personal settings will not be saved #3959

720720 opened this issue Apr 16, 2017 · 6 comments
Labels
bug Something that's not working as intended needs more info

Comments

@720720
Copy link

720720 commented Apr 16, 2017

root@freebsd ~# dmesg -a
fish: Your personal settings will not be saved.
fish: Unable to locate config directory derived from $HOME: '//.config/fish'.
fish: The error was 'Permission denied'.
fish: Please set $HOME to a directory where you have write access.

root@freebsd ~# uname -a
FreeBSD freebsd 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016

root@freebsd ~# pkg info fish
fish-2.5.0
Name: fish
Version: 2.5.0
Installed on: Sun Apr 16 11:54:33 2017 CEST
Origin: shells/fish
Architecture: FreeBSD:11:amd64

root@freebsd ~# ls -ld $HOME
drwxr-xr-x 10 root wheel 512 Apr 16 15:03 /root
root@freebsd ~# ls -ld $HOME/.config
drwxr-xr-x 5 root wheel 512 Apr 16 12:06 /root/.config
root@freebsd ~# ls -ld $HOME/.config/fish
drwxr-xr-x 2 root wheel 512 Apr 16 12:01 /root/.config/fish

@faho
Copy link
Member

faho commented Apr 16, 2017

So, this is weird. The only way you should be getting that error is if both $HOME nor $XDG_CONFIG_HOME are unset or empty when fish starts.

How do you get that root shell? Via sudo, su or just plain logging in?

I'm assuming those other lines are from another shell. Can you echo $HOME inside fish? Also echo $USER for good measure.

@720720
Copy link
Author

720720 commented Apr 16, 2017

Virtual Machine: VirtualBox 5.1.18
Host: Windows 10
Guest: FreeBSD 11.0
Network: VirtualBox Host-only Adapter
SSH Client: PuTTY 0.68
Authentication: Private Key
Hostname: root@192.168.56.2
Login Shell: Fish 2.5.0

All lines are inside fish.

@faho
Copy link
Member

faho commented Apr 16, 2017

@720720: And how do you get to that shell? Via ssh?

Is fish set as your default shell (via chsh)? Or do you execute it from somewhere else? Did you su or sudo? Do you have anything in your ~/.config/fish/config.fish? In particular anything setting $HOME or $USER?

Also, what does locale output? I know we've had a locale-related issue with FreeBSD in the recent past, so this could be a manifestation of that.

When in doubt, please err on the side of too much information.

@faho faho added bug Something that's not working as intended needs more info labels Apr 16, 2017
@krader1961
Copy link
Contributor

I can't reproduce this with FreeBSD 12.0. I enabled root logins via ssh (which is a very bad idea) and did chsh -s /usr/local/bin/fish root. I then had no difficulty executing ssh root@freebsd2 and confirmed my login shell was fish and HOME was set to /root. Same with su -l.

Note that the error message says '//.config/fish' which means $HOME was set to /. I also don't understand why you ran dmesg -a or why those errors would show up in that buffer. Fish writes that error to stderr which should be attached to the pty (i.e., the terminal) at that point. Are you actually seeing that error when you login? Also, even if you had done chmod 0 /.config/fish the root account would still be able to access that path. I verified that on my system as well. Finally, the ls -ld $HOME command you ran clearly shows it set to /root as expected. So there is something weird about your system or, more likely, the errors in the dmesg buffer are because you're trying to run fish from a daemon other than sshd where stderr is

Running man dmesg contains this text so perhaps this has something to do with logging in at the console rather than via ssh:

     -a      Show all data in the message buffer.  This includes any syslog
             records and /dev/console output.

However, after making the aforementioned changes, rebooting my system, and logging in at the console I'm still not seeing those errors; either interactively or in the dmesg -a output. So there is something weird about your system configuration.

@720720
Copy link
Author

720720 commented Apr 17, 2017

FreeBSD-11.0-RELEASE-amd64-disc1.iso

root@freebsd:~ # pkg install -y fish mysql57-server
root@freebsd:~ # chsh -s fish
root@freebsd:~ # sysrc mysql_enable=YES
root@freebsd:~ # reboot

root@freebsd ~# dmesg -a | grep fish
fish: Your personal settings will not be saved.
fish: Unable to locate config directory derived from $HOME: '//.config/fish'.
fish: The error was 'Permission denied'.
fish: Please set $HOME to a directory where you have write access.

root@freebsd ~# service mysql-server restart
Stopping mysql.
fish: Your personal settings will not be saved.
fish: Unable to locate config directory derived from $HOME: '//.config/fish'.
fish: The error was 'Permission denied'.
fish: Please set $HOME to a directory where you have write access.

Waiting for PIDS: 1921.
Starting mysql.
fish: Your personal settings will not be saved.
fish: Unable to locate config directory derived from $HOME: '//.config/fish'.
fish: The error was 'Permission denied'.
fish: Please set $HOME to a directory where you have write access.

@faho
Copy link
Member

faho commented Apr 17, 2017

@720720: It looks like mysql starts stuff with the user's shell. Nothing should do that - if you want to run a script, run it with the shell you wrote it for. The only reason for other programs to use $SHELL is to drop the user into a shell to do stuff.

I suggest you report a bug to FreeBSD, unless you did weird stuff with mysql (e.g. run chsh for the mysql user).

@faho faho closed this as completed Apr 17, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended needs more info
Projects
None yet
Development

No branches or pull requests

3 participants