You are not logged in.

#26 2012-01-04 18:23:47

corvinus
Member
Registered: 2011-09-05
Posts: 8

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

There's still note in post_install() function in readme.install file saying that you need to add entry to root crontab manually.
Below that is text saying that you do not need to do it. :]

Offline

#27 2012-01-04 19:14:05

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Corrected, thanks!


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#28 2012-01-12 15:36:04

masteryod
Member
Registered: 2010-05-19
Posts: 433

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

possible bug:

On one machine I have user named X but home directory actually is /home/Y   (user setup via adduser, X and Y are just for simplification)

with USERS set to X in /etc/psd.conf I get this:

# /etc/rc.d/psd start
:: Starting Profile-Sync-Daemon                                                        [BUSY] 
Error: Invalid user defined in /etc/psd.conf                                           [FAIL] 

but restart gives:

# /etc/rc.d/psd restart
:: Syncing browser profiles in tmpfs to physical disc                                  [DONE]

with USERS set to Y, I get this:

# /etc/rc.d/psd start
:: Starting Profile-Sync-Daemon                                                        [BUSY]
su: user Y doesn't exist
su: user Y doesn't exist
su: user Y doesn't exist

after this /home/Y/.mozilla is symlinked to /tmp/.Y-mozilla but in /tmp ther is no such directory

which leads to Firefox error:

Your Firefox profile cannot be loaded. It may be missing or inaccessible.

permisions checked:

# ls -ld /tmp
drwxrwxrwt 13 root root 320 01-12 16:21 /tmp

Last edited by masteryod (2012-01-12 22:00:17)

Offline

#29 2012-01-12 18:56:58

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Psd expects the user you defined in /etc/psd.conf to have a matching home directory.  In your case, make a minor tweak to your users array which I think will work for you, just insert the name of user X's homedir which in your case is Y.

users="foo bar Y"

Have a look at /usr/bin/profile-sync-daemon to see how it works.  Psd doesn't really care about your users, it just cares about their respective home directories.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#30 2012-01-12 21:59:14

masteryod
Member
Registered: 2010-05-19
Posts: 433

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

graysky wrote:

Psd expects the user you defined in /etc/psd.conf to have a matching home directory.  In your case, make a minor tweak to your users array which I think will work for you, just insert the name of user X's homedir which in your case is Y.

This is exactly what I did second time, and it brings error as described above in my post (I'm not sure if it's bug or something with my configuration but it's reproducible)

Offline

#31 2012-01-12 22:22:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

My bad.  You are correct.  For psd to work properly, the username must match the user's homedir.  Let me see if I can modify it to work with a mis-matched setup and get back to you.  Thank you for the feedback!


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#32 2012-01-12 23:00:45

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

OK... I believe it's fixed now to work with asymmetrical user/homedirs.  Please try version 2.7 and let me know (worked on my test setup).

Last edited by graysky (2012-01-12 23:01:13)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#33 2012-01-14 10:00:49

broken pipe
Member
Registered: 2010-12-10
Posts: 243

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

thanks for supporting midori. i can't figure it out, but it still read/writes on the HD when i start it, is it normal?
.config/midori is outsourced by psd and .cache/midori is also bound to /dev/shm/tmp.

edit: SOLVED ... automatically removal of cookies/cache/... was enabled.

Last edited by broken pipe (2012-01-14 10:22:53)

Offline

#34 2012-01-14 19:25:45

crabman
Member
Registered: 2010-08-12
Posts: 30

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

I hve added google-chrome support and a systemd .service file. Would be glad if they could be added to the default package

crabman

psd.service

[Unit]
Description=Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers
Wants=local-fs.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/rc.d/psd start
ExecStop=/etc/rc.d/psd stop

[Install]
WantedBy=multi-user.target

google-chrome patch

*** profile-sync-daemon 2012-01-14 00:45:31.000000000 +0100
--- profile-sync-daemon.new     2012-01-14 19:59:45.698831292 +0100
***************
*** 18,23 ****
--- 18,26 ----
                chromium)
                        [[ "$i" = "chromium" ]] && STATIC="$homedir/.config/$i-backup" && LINK="$homedir/.config/$i"
                        ;;
+               google-chrome)
+                       [[ "$i" = "google-chrome" ]] && STATIC="$homedir/.config/$i-backup" && LINK="$homedir/.config/$i"
+                       ;;
                midori)
                        [[ "$i" = "midori" ]] && STATIC="$homedir/.config/$i-backup" && LINK="$homedir/.config/$i"
                        ;;
***************
*** 30,36 ****
  sync() {
        # sync profiles to tmpfs and back again
        for user in $USERS; do
!               for i in mozilla chromium opera midori; do
                        set_which
                        # check if user has browser profile
                        if [[ -d $LINK ]]; then
--- 33,39 ----
  sync() {
        # sync profiles to tmpfs and back again
        for user in $USERS; do
!               for i in mozilla chromium google-chrome opera midori; do
                        set_which
                        # check if user has browser profile
                        if [[ -d $LINK ]]; then
***************
*** 59,65 ****
  debug() {
        # sync profiles to tmpfs and back again
        for user in $USERS; do
!               for i in mozilla chromium opera midori; do
                        set_which
                        echo $user:$homedir:$i
                done
--- 62,68 ----
  debug() {
        # sync profiles to tmpfs and back again
        for user in $USERS; do
!               for i in mozilla chromium google-chrome opera midori; do
                        set_which
                        echo $user:$homedir:$i
                done
***************
*** 70,76 ****
  check() {
        # crash recovery
        for user in $USERS; do
!               for i in mozilla chromium opera; do
                        set_which
                        [[ -h $LINK ]] && rm -f $LINK
                        [[ -d $STATIC ]] && mv $STATIC $LINK
--- 73,79 ----
  check() {
        # crash recovery
        for user in $USERS; do
!               for i in mozilla chromium google-chrome opera; do
                        set_which
                        [[ -h $LINK ]] && rm -f $LINK
                        [[ -d $STATIC ]] && mv $STATIC $LINK
***************
*** 81,87 ****
  unsync() {
        # restore virgin state of profiles on physical discs
        for user in $USERS; do
!               for i in mozilla chromium opera midori; do
                        set_which
                        # check if user has browser profile
                        if [[ -h $LINK ]]; then
--- 84,90 ----
  unsync() {
        # restore virgin state of profiles on physical discs
        for user in $USERS; do
!               for i in mozilla chromium google-chrome opera midori; do
                        set_which
                        # check if user has browser profile
                        if [[ -h $LINK ]]; then

Offline

#35 2012-01-14 20:27:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

@crabman - glad to add support for google-chrome, thanks for the patch.  I haven't used systemd before.  Please direct me where "psd.service" should get installed, who should own it, and what should it's permissions be?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#36 2012-01-15 00:39:54

crabman
Member
Registered: 2010-08-12
Posts: 30

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

@ graysky: the file should go to /lib/systemd/system/, be owned by root:root and have  644 permissions. This way systemd-users can enable it with a simple systemctl enable psd.service.

crabman

Offline

#37 2012-01-15 01:31:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Cool, done (v2.9) - please test it out.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#38 2012-01-15 02:00:05

canen
Member
From: Jamaica
Registered: 2008-11-28
Posts: 35

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

psd.service seems to work here on regular stop and start; we'll have to see if it works on reboot.

==> sudo systemctl status psd.service                                                             
psd.service - Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers
          Loaded: loaded (/lib/systemd/system/psd.service; enabled)
          Active: active (exited) since Sat, 14 Jan 2012 20:57:46 -0500; 7s ago
         Process: 591 ExecStart=/etc/rc.d/psd start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/psd.service

Offline

#39 2012-01-15 11:47:35

masteryod
Member
Registered: 2010-05-19
Posts: 433

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

graysky wrote:

OK... I believe it's fixed now to work with asymmetrical user/homedirs.

Yep, seems that everything is working properly, big thanks for your work!

Offline

#40 2012-01-15 12:12:55

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

masteryod wrote:

Yep, seems that everything is working properly, big thanks for your work!

Always glad to give back the community.  Thanks for bug report wink


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#41 2012-01-15 13:18:12

masteryod
Member
Registered: 2010-05-19
Posts: 433

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

graysky wrote:

Always glad to give back the community.  Thanks for bug report wink

At least I can do a bug reporting smile

Offline

#42 2012-01-23 10:47:26

corvinus
Member
Registered: 2011-09-05
Posts: 8

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

On deletion of the package it does not stop daemon, therefore leaving profile in /tmp (!), with no possibility to stop it manually (since psd script is deleted).

It also says "Be sure to remove the entry in the root crontab!" while this doesn't seem necessary.

Therefore I installed it again, then decided to leave it running so far. That new BROWSERS variable is awesome!

Offline

#43 2012-01-23 11:04:35

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

corvinus wrote:

On deletion of the package it does not stop daemon, therefore leaving profile in /tmp (!), with no possibility to stop it manually (since psd script is deleted).

It also says "Be sure to remove the entry in the root crontab!" while this doesn't seem necessary.

Therefore I installed it again, then decided to leave it running so far. That new BROWSERS variable is awesome!

Well, there is nothing to be done if the user removes a running daemon without stopping it....
I suspect you were running an older version of psd because I made the edit that removes that message a while ago.  Thanks for pointing it out though.  Enjoy the daemon.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#44 2012-01-23 11:32:46

corvinus
Member
Registered: 2011-09-05
Posts: 8

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

graysky wrote:

Well, there is nothing to be done if the user removes a running daemon without stopping it....
I suspect you were running an older version of psd because I made the edit that removes that message a while ago.  Thanks for pointing it out though.  Enjoy the daemon.

Why not stop the daemon in the script that wrote the above message? I don't remember, but I think I saw a package that behave this way.

My fault regarding the message, I just reported same bug twice.

Offline

#45 2012-01-23 12:08:38

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Stopping the daemon on removal is a brilliant idea.  I will make the change and update later today.  Thanks.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#46 2012-01-25 08:54:07

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,645
Website

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Damn, fell off my radar screen.  Done now in profile-sync-daemon 3.0-2 - thanks again for the suggestion!

http://pkgbuild.com/git/aur.git/commit/ … de96f8bdd2

Last edited by graysky (2012-01-25 10:00:17)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#47 2012-01-26 00:17:15

ccom
Member
Registered: 2011-06-28
Posts: 30

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Google Chrome also uses the directory ~/.cache/google-chrome. Is it possible/desirable to include it into psd?

Offline

#48 2012-01-26 10:59:28

ccom
Member
Registered: 2011-06-28
Posts: 30

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

Maybe adding

                cache)
                        [[ "$i" = "cache" ]] && STATIC="$homedir/.$i-backup" && LINK="$homedir/.$i"
                        ;;

is a good idea.

Offline

#49 2012-01-26 11:28:13

ccom
Member
Registered: 2011-06-28
Posts: 30

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

I found two more offending directories: .adobe and .macromedia. They are used by flashplugin.

Offline

#50 2012-01-26 11:34:06

broken pipe
Member
Registered: 2010-12-10
Posts: 243

Re: profile-sync-daemon - keep browser profiles in tmpfs and sync'ed

you can also swap those dirs into tmpfs --> fstab:

tmpfs /home/user/.thumbnails tmpfs defaults,noatime 0 0
tmpfs /home/user/.cache tmpfs defaults,noatime 0 0

Offline

Board footer

Powered by FluxBB