I sometimes want to run chromium with a new profile or with a copy of an 
existing profile and destroy any changes to the profile at the end of the 
session. To do this without relaxing unveil, I put the profile in /tmp, which 
chromium has rw access to, and then destroy the profile on exit. It looks 
something like this (simplifying from my use case):

```
#!/bin/sh

# Set variable 'src' somewhere (either pass it in or set it somewhere in 
# the script) if you don't want a fresh profile every time. This acts as 
# a kind of template profile.
src="${HOME}/.config/chromium_a"
temp="$(mktemp -t -d chromium.XXXXXXX)"
if [ -d "$src" ]; then
    rsync -a "${src}/" "$temp"
fi

chrome \
    --user-data-dir="${temp}" \
    --enable-unveil "$@"

# In practice you'll want to either control whether the profile is destroyed
# or provide a knob to sync changes back to src so you can setup or update 
# the template profile for your needs. We just destroy it in this example.
if [ -d "$src" ]; then
    rm -rf "$temp"
fi
```


On Wed, Jan 29, 2020, at 18:03, Allan Streib wrote:
> Per the man page I have tried to launch chrome with an alternate data
> directory hoping to achieve separate profiles.
> 
>     $ chrome --user-data-dir=~/.config/chromium_a
> 
>     
> [75336:1591778608:0129/114259.294272:ERROR:process_singleton_posix.cc(280)] 
> Failed to create /home/astreib/.config/chromium_a/SingletonLock: No such file 
> or directory (2)
>     
> [75336:1591778608:0129/114259.294449:ERROR:chrome_browser_main.cc(1413)] 
> Failed to create a ProcessSingleton for your profile directory. This means 
> that running multiple instances would start multiple browser processes rather 
> than opening a new window in the existing process. Aborting now to avoid 
> profile corruption.
>     [75336:-995142592:0129/114259.302586:ERROR:cache_util.cc(141)] 
> Unable to move cache folder 
> /home/astreib/.config/chromium_a/ShaderCache/GPUCache to 
> /home/astreib/.config/chromium_a/ShaderCache/old_GPUCache_000
>     [75336:-995142592:0129/114259.302696:ERROR:disk_cache.cc(178)] 
> Unable to create cache
>     
> [75336:-995142592:0129/114259.302721:ERROR:shader_disk_cache.cc(605)] 
> Shader Cache Creation failed: -2
> 
> I have tried this with ~/.config/chromium_a as an empty directory, and
> as a copy of ~/.config/chromium (which is created successfully when
> chrome is started without any args).
> 
> Thought I would ask if this is simply a known problem before I go
> digging too deeply.
> 
> amd64 6.6 release with syspatches and pkg updates applied as of today.
> 
> Allan
> 
>

Reply via email to