Any reasons a symlink won't work for profile directories?
Moderator: trava90
Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Any reasons a symlink won't work for profile directories?
(Long-time Linux user, new to Pale Moon, coming from Firefox.)
I have some scripts that need to do 'find' of a filename ('lock' for example) inside the browser's profile tree. Some of those scripts don't work well with the spaces in directory names '.moonchild productions' and 'pale moon'. I also manually do 'find' and 'du' and 'ls' commands on a fairly frequent basis to look around the profile tree (to find disk space usage anomalies, for example). The spaces in the directory names make those operations less convenient. A search of this forum found these topics:
viewtopic.php?f=37&t=21441&p=161847&hil ... me#p161847
viewtopic.php?f=37&t=17108&p=125311&hil ... me#p125311
From those topics, I understand that Pale Moon is hardcoded to look in "$HOME/.moonchild productions/pale moon" for profiles and there's no option to change that path to avoid the spaces in the directory names.
Rather than rewrite _every_ _one_ of my affected scripts to tolerate spaces in directory names '.moonchild productions' and 'pale moon', I'd like to try renaming the two directories with a hyphen instead of a space and then create a near-twin symlink for each so that the real path is "$HOME/.moonchild-productions/pale-moon" but the symlinks cause "$HOME/.moonchild productions/pale moon" to end up in the same place.
Are there any known reasons that won't work? Or, in other words, has anyone here already tried it and found reasons it won't work? If so, what are those reasons?
Thank you.
I have some scripts that need to do 'find' of a filename ('lock' for example) inside the browser's profile tree. Some of those scripts don't work well with the spaces in directory names '.moonchild productions' and 'pale moon'. I also manually do 'find' and 'du' and 'ls' commands on a fairly frequent basis to look around the profile tree (to find disk space usage anomalies, for example). The spaces in the directory names make those operations less convenient. A search of this forum found these topics:
viewtopic.php?f=37&t=21441&p=161847&hil ... me#p161847
viewtopic.php?f=37&t=17108&p=125311&hil ... me#p125311
From those topics, I understand that Pale Moon is hardcoded to look in "$HOME/.moonchild productions/pale moon" for profiles and there's no option to change that path to avoid the spaces in the directory names.
Rather than rewrite _every_ _one_ of my affected scripts to tolerate spaces in directory names '.moonchild productions' and 'pale moon', I'd like to try renaming the two directories with a hyphen instead of a space and then create a near-twin symlink for each so that the real path is "$HOME/.moonchild-productions/pale-moon" but the symlinks cause "$HOME/.moonchild productions/pale moon" to end up in the same place.
Are there any known reasons that won't work? Or, in other words, has anyone here already tried it and found reasons it won't work? If so, what are those reasons?
Thank you.
-
- Apollo supporter
- Posts: 46
- Joined: 2015-07-31, 04:53
- Location: Clown World
Re: Any reasons a symlink won't work for profile directories?
That's correct. Its unfortunate that a space is included but the status quo appears unlikely to change.rmrichesjr wrote: ↑2019-07-14, 03:51From those topics, I understand that Pale Moon is hardcoded to look in "$HOME/.moonchild productions/pale moon" for profiles and there's no option to change that path to avoid the spaces in the directory names.
Firstly, you really should fix your scripts. Quoting variable expansions isn't merely a matter of correctly handling paths with spaces. Quoting protects against other forms of expansion from being applied to the variable's value and is vital from a standpoint of correctness and safety. Testing your scripts with shellcheck.net and focusing on the SC2086 warning would ease the burden of doing this.rmrichesjr wrote: ↑2019-07-14, 03:51Rather than rewrite _every_ _one_ of my affected scripts to tolerate spaces in directory names '.moonchild productions' and 'pale moon', I'd like to try renaming the two directories with a hyphen instead of a space and then create a near-twin symlink for each so that the real path is "$HOME/.moonchild-productions/pale-moon" but the symlinks cause "$HOME/.moonchild productions/pale moon" to end up in the same place.
Are there any known reasons that won't work? Or, in other words, has anyone here already tried it and found reasons it won't work? If so, what are those reasons
Secondly, I'm not aware of any reason for the strategy that you describe not to work. I just gave it a quick try and Pale Moon seemed happy to follow "$HOME/.moonchild productions/pale moon" in its capacity as a symlink. That said, symlinks are obviously not directories and I have very occasionally encountered applications in the past that exhibit side-effects when operating on symlinks instead of directories. I would not personally trust Pale Moon never to exhibit any side effects. Therefore, you might also consider inverting your intended strategy:
Code: Select all
cd &&
mkdir .moonchild-productions &&
cd .moonchild-productions &&
ln -s "../.moonchild productions/pale moon" pale-moon
-
- Fanatic
- Posts: 118
- Joined: 2015-12-17, 18:28
- Location: UK
Re: Any reasons a symlink won't work for profile directories?
I've always used a symlink for Firefox (when I used it way back), Thunderbird and Pale Moon profile directories. No issues here.rmrichesjr wrote: ↑2019-07-14, 03:51Are there any known reasons that won't work? Or, in other words, has anyone here already tried it and found reasons it won't work? If so, what are those reasons?
This, as plushkava says. As a long time Linux user I'm absolutely amazed you're not already doing it! Spaces are not an issueplushkava wrote: ↑2019-07-14, 05:31Firstly, you really should fix your scripts. Quoting variable expansions isn't merely a matter of correctly handling paths with spaces. Quoting protects against other forms of expansion from being applied to the variable's value and is vital from a standpoint of correctness and safety. Testing your scripts with shellcheck.net and focusing on the SC2086 warning would ease the burden of doing this.
Pale Moon and Epyrus on Arch Linux.
-
- Board Warrior
- Posts: 1651
- Joined: 2018-06-08, 17:02
Re: Any reasons a symlink won't work for profile directories?
You don't necessarily need to use Profile Manager - at all.
You can use the -profile switch to point to a profile location.
You can use the -profile switch to point to a profile location.
-
- Apollo supporter
- Posts: 47
- Joined: 2018-07-23, 22:32
Re: Any reasons a symlink won't work for profile directories?
I keep the original directories along original path like so:
/home/YOUUSERNAME/.moonchild productions/pale moon/profiles.ini
but only the profile.ini file resides there.
The stanzas within the profile.ini point to the
the real locations of my profile directories which have been
renamed to eliminate the spaces.
As an example:
/home/YOUUSERNAME/.moonchild productions/pale moon/profiles.ini
but only the profile.ini file resides there.
The stanzas within the profile.ini point to the
the real locations of my profile directories which have been
renamed to eliminate the spaces.
As an example:
Code: Select all
[General]
StartWithLastProfile=0
[Profile0]
Name=Palemoon-24
IsRelative=0
Path=/home/YOURUSERNAME/.moonchild-productions/pale-moon/whatever.default
[Profile1]
Name=Palemoon-27-firejail
IsRelative=0
Path=/home/YOURUSERNAME/.moonchild-productions/pale-moon/whatever.27-firejail
[Profile2]
Name=Palemoon-28-firejail
IsRelative=0
Path=/home/YOURUSERNAME/.moonchild-productions/pale-moon/whatever.28-firejail
-
- Astronaut
- Posts: 652
- Joined: 2015-07-30, 20:29
- Location: Vaughan, ON, Canada
Re: Any reasons a symlink won't work for profile directories?
I do homebrew builds for a few machines at home (desktops and a laptop). To save space, avoid downloading multiple copies of source, avoid maintaining multiple build scripts, etc, I use symlinks. I can't duplicate it now, but I do remember once having run into strange results when using relative pathnames, while jumping around in symlinked directories. To guard against this, I use absolute pathnames, storing them in a variable. E.g. in my build script (bash) I start off with
startdir="${PWD}"
The build scipt contains a few references to the startdir
export builddir="${startdir}/pmbuild"
./mach build &> /dev/stdout | tee ${startdir}/buildlog.txt
./mach package &> /dev/stdout | tee ${startdir}/packagelog.txt
cd ${startdir}
startdir="${PWD}"
The build scipt contains a few references to the startdir
export builddir="${startdir}/pmbuild"
./mach build &> /dev/stdout | tee ${startdir}/buildlog.txt
./mach package &> /dev/stdout | tee ${startdir}/packagelog.txt
cd ${startdir}
There's a right way
There's a wrong way
And then there's my way
There's a wrong way
And then there's my way
Re: Any reasons a symlink won't work for profile directories?
Dnes is drunk again. He only tries to give linux advice when he is drunk.
-
- Apollo supporter
- Posts: 43
- Joined: 2019-09-14, 20:09
- Location: King's Lynn, UK
Re: Any reasons a symlink won't work for profile directories?
Interesting. I have to confess that the 'standard' profile location appears to be modifiable quite easily.
Over at the Puppy Linux forums, we turn bog-standard releases of Palemoon into 'portable' versions by the simple addition of a small script, that has been 'floating' around the web for years. This script was probably developed for Firefox itself, yet it seems to work for the majority of all Mozilla-related browsers. This script makes use of the '-profile' flag; it creates a sub-directory within the Palemoon directory, simply called 'profile'. The browser is then told to create its profile within this sub-directory instead, and to always look here to find it. And it seems to work as well with Palemoon as it does any of the others.
'Portable' has a somewhat different meaning for Puppy, compared to most other distros. For Puppy, a 'portable' application is any app which lives outside of the user's 'save-file' in its entirety (this is where the user's personal configurations/customizations are kept) - the object in Puppy-land being to keep this item (the 'save-file') as small as is humanly possible, given that many Puppy users use truly ancient, often low-powered & RAM-challenged hardware.....
You can see an example of this 'launch' script here:-
https://forum.palemoon.org/viewtopic.php?p=174936#p174936
I, personally, use this method to share a single instance of the browser between multiple Puppies in my kennels - currently running 11 of them.
Mike.
Over at the Puppy Linux forums, we turn bog-standard releases of Palemoon into 'portable' versions by the simple addition of a small script, that has been 'floating' around the web for years. This script was probably developed for Firefox itself, yet it seems to work for the majority of all Mozilla-related browsers. This script makes use of the '-profile' flag; it creates a sub-directory within the Palemoon directory, simply called 'profile'. The browser is then told to create its profile within this sub-directory instead, and to always look here to find it. And it seems to work as well with Palemoon as it does any of the others.
'Portable' has a somewhat different meaning for Puppy, compared to most other distros. For Puppy, a 'portable' application is any app which lives outside of the user's 'save-file' in its entirety (this is where the user's personal configurations/customizations are kept) - the object in Puppy-land being to keep this item (the 'save-file') as small as is humanly possible, given that many Puppy users use truly ancient, often low-powered & RAM-challenged hardware.....
You can see an example of this 'launch' script here:-
https://forum.palemoon.org/viewtopic.php?p=174936#p174936
I, personally, use this method to share a single instance of the browser between multiple Puppies in my kennels - currently running 11 of them.
Mike.
Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE!
_______________________________________________________
_______________________________________________________