graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
903 stars 85 forks source link

Debian 8 - ReSync & Shutdown Timers #128

Closed jonpolak closed 9 years ago

jonpolak commented 9 years ago

Can you add to the man page a listing of the timers that should be there?

I'm asking this because systemctl is-enabled psd = enabled and psd is running - but I lose the profiles each reboot. I didn't find a cron for the 10 min timer, or the shutdown resync call.

Very grateful for this script - it should be standard in the distro! A suggestion for the section to add to the man / README would be:

This is what you should see after successful install:

blah blah


I obviously don't know enough to even know whether the install went well -- I installed from your PPA - I'm on Debian 8 JESSIE

graysky2 commented 9 years ago

The PPA packages assume you're using sysv not systemd. If Jesse uses systemd by default, I need to update the packages to do so as well. I recommend that you remove the package from my PPA and compile from source:

make
sudo make install-systemd-all

Remember that once installed, you will need to enable the service manually like any other systemd service. Please do so and report back. You can also verify timer enable status like this:

systemctl list-timers
jonpolak commented 9 years ago

Your README says the opposite of your reply to issue:

Debian Users

You must be using AT LEAST Debian 8.0 (Jessie) or have systemd as your init system to use these packages!

Did you mean to say sysv?

jonpolak commented 9 years ago

Following your instruction, I removed the version downloaded from PPA. Then make ; sudo make install-systemd-allI didn't set any timers manually. Does the psd.service do that? Here's the output:


root-> systemctl start psd.service
root-> systemctl is-enabled psd.service 
       enabled
root-> systemctl status psd       
    psd.service - Profile-sync-daemon
    Loaded: loaded (/usr/lib/systemd/system/psd.service; enabled)
    Active: active (exited) since Thu 2015-09-03 10:56:26 PDT; 15s ago
    Docs: man:psd(1)
           man:profile-sync-daemon(1)
           https://wiki.archlinux.org/index.php/Profile-sync-daemon
    Process: 6811 ExecStart=/usr/bin/profile-sync-daemon sync (code=exited, status=0/SUCCESS)
    Main PID: 6811 (code=exited, status=0/SUCCESS)
    CGroup: /system.slice/psd.service

Sep 03 10:56:26 thinkpad profile-sync-daemon[6811]: Sync successful

root-> systemctl status psd-resync.service 
    psd-resync.service - Timed Profile-resync
    Loaded: loaded (/usr/lib/systemd/system/psd-resync.service; disabled)
    Active: inactive (dead) since Thu 2015-09-03 10:56:26 PDT; 2min 35s ago
    Docs: man:psd(1)
           man:profile-sync-daemon(1)
           https://wiki.archlinux.org/index.php/Profile-sync-daemon
    Process: 6903 ExecStart=/usr/bin/profile-sync-daemon resync (code=exited, status=0/SUCCESS)
    Main PID: 6903 (code=exited, status=0/SUCCESS)

Sep 03 10:56:26 merperthinkpad profile-sync-daemon[6903]: Sync successful

root-> systemctl is-enabled psd-resync.service        
       disabled

root-> systemctl status psd-resync.timer 
    psd-resync.timer - Timer for Profile-sync-daemon - 1Hour
    Loaded: loaded (/usr/lib/systemd/system/psd-resync.timer; static)
    Active: active (waiting) since Thu 2015-09-03 10:43:23 PDT; 14min ago

root-> systemctl is-enabled  psd-resync.timer 
       static

root-> systemctl list-timers --all
NEXT                         LEFT         LAST                         PASSED     UNIT                         ACTIVATES
Thu 2015-09-03 11:56:26 PDT  40min left   n/a                          n/a        psd-resync.timer             psd-resync.service
Thu 2015-09-03 16:23:42 PDT  5h 7min left Mon 2015-08-31 21:49:02 PDT  2 days ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
n/a                          n/a          n/a                          n/a        systemd-readahead-done.timer systemd-readahead-done.service

3 timers listed.
graysky2 commented 9 years ago

Ah, the README was from a brief period of time when I was only going to support systemd. I neglected to change it back. Ironically, now, I feel that I should abandon the sysv stuff and again, only supoort systemd. I have version 6.00 in my unstable branch that has been rock solid for me since I pushed it there. It is more flexible, runs as your users (no more /etc/psd.conf) and is systemd-only.

To your output of systemctl list-timers --all it looks normal: the service will autostart the timers as your output indicates. You can also query the status with a simple psd p

graysky2 commented 9 years ago

OK. Are you willing to try out the prerelease version 6.00? I have it installed on Debian 8.1 in a virtualbox and it is running just fine. You can either download the source and compile install yourself or use a deb I packaged.

Source: https://github.com/graysky2/profile-sync-daemon/archive/v6.00pre.tar.gz Deb: http://repo-ck.com/bench/profile-sync-daemon_6.00pre-1_all.deb

jonpolak commented 9 years ago

I'll try it tonight. On Sep 4, 2015 3:22 PM, "graysky" notifications@github.com wrote:

OK. Are you willing to try out the prerelease version 6.00? I have it installed on Debian 8.1 in a virtualbox and it is running just fine. You can either download the source and compile install yourself or use a deb I packaged.

https://github.com/graysky2/profile-sync-daemon/archive/v6.00pre.tar.gz http://repo-ck.com/bench/profile-sync-daemon_6.00pre-1_all.deb

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-137870539 .

jonpolak commented 9 years ago

Upgrade Process

can I simply install over the old release of PSD?

root > systemctl stop psd
root > make install-systemd-all
graysky2 commented 9 years ago

Yes, but make sure you stop psd before you do that so your profiles rotate back.

graysky2 commented 9 years ago

By the way, I just pushed v6.00 to master so it's officially released/not unstable if that matters. I will update the PPA in a few weeks once I get feedback from the Arch users who can now update to 6.00 on their own.

jonpolak commented 9 years ago

RE: dev/shm & upgrade process

This was taken without psd running when systemctl stop psd it killed the chrome & firefox processes that were open at the time. Is this expected behavior?

output of df -h

joni-> sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5       152G   28G  116G  20% /
udev             10M     0   10M   0% /dev
tmpfs           1.6G   18M  1.6G   2% /run
tmpfs           3.9G   59M  3.8G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           400M     0  400M   0% /home/username/.cache
/dev/sda2        96M   29M   68M  31% /boot/efi
tmpfs           783M  4.0K  783M   1% /run/user/110
tmpfs           783M   12K  783M   1% /run/user/1000
/dev/sda4       293G   94G  200G  32% /media/joni/8A2C64332C641D07
graysky2 commented 9 years ago

If you used the deb, it has post_install scripts that should have stopped psd for you which will close browsers so their profiles can be preserved. Without this, you risk losing data.

Yes, it looks like /dev/shm is indeed the correct location for tmpfs on Debian (I independently confirmed this in a vbox with 8.1).

jonpolak commented 9 years ago

I compiled ver 6.

Upon make install errors on symbolic link psd -> profile-sync.... already existing. And errors about man file also existing. After removing those manually make install completed successfully.

There is confusion around

    /etc/psd.conf
    /home/user/.psd/psd.conf 
    /root/.psd/psd.conf  

I installed as root, and running psd p is complaining about /root/.psd/psd.conf not being configured

root-> psd p
 This version of psd does not support /etc/psd.conf since it runs as your user.
 Recommend that you remove /etc/psd.conf and run it in systemd's user mode:
   systemd --user <action> psd.service

 Profile-sync-daemon v6.00 on SolydXK

 /usr/bin/psd [option]
  preview       Parse config file **(/root/.psd/psd.conf)** to see which profiles will be managed.
  clean         Clean (delete without prompting) ALL crashrecovery dirs for all profiles.

Is psd now user mode only? Debian 8.x is currently on kernel 3.16 - which does not have overlay. It will move to So root permissions aren't necessary (yet).

I tried it from my user (without sudo). systemctl status psd --> you don't have persmissions however systemctl start psd --> it starts and looks for ~/.psd/psd.conf

graysky2 commented 9 years ago

The conflicts on the filesystem are due to the old version being in place. If you make uninstall from the 5.75 source it should remove them. With version 6.00 there is no need to run psd as root. Just run it as your user and with your user service.

The first time it is run, your config is created (~/.psd/psd.conf):

$ psd
First time running psd so please edit /home/facade/.psd/psd.conf to your liking and run again.

When optionally you edit the config file, start the user service:

$ systemctl --user start psd.service
graysky2 commented 9 years ago

The timer has been fixed since release 6.02. Please try the latest. Do you need a deb or are you good building from source?

EDIT: btw, ~/.psd is deprecated in 6.03 favoring the XDG standards. The script will autocorrect this for you and inform you of it.

https://github.com/graysky2/profile-sync-daemon/commit/005a2991816821f2f6a5fcbd5290adf219caa01c

jonpolak commented 9 years ago

What's the new make install commands, since specifying systemd is irrelevant now. On Sep 8, 2015 12:06 AM, "graysky" notifications@github.com wrote:

The timer has been fixed since release 6.02. Please try the latest.

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-138457131 .

graysky2 commented 9 years ago

It's a relic from the multi-support architecture. Point is that the install target will do install-bin install-man install-systemd for you

make
sudo make install
graysky2 commented 9 years ago

I packaged the latest and greatest version (6.10) for ubuntu/debian. Care to try it? Note, please stop psd v6.x first. If you're using v5.x it should do everything automatically.

http://repo-ck.com/bench/profile-sync-daemon_6.10-1_all.deb

jonpolak commented 9 years ago

Hello. I will do so. I changed the kernel to one that supports fs_overlay. Still start psd as user? On Sep 12, 2015 11:07 AM, "graysky" notifications@github.com wrote:

I packaged the latest and greatest version (6.08) for ubuntu/debian. Care to try it? Note, please stop psd v6.x first. If you're using v5.x it should do everything automatically.

http://repo-ck.com/bench/profile-sync-daemon_6.08-1_all.deb

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-139804867 .

graysky2 commented 9 years ago

Yes. Note that I just checked in a VM and 8.2.0 does not provide modinfo out-of-the-box which is needed. You can install it via apt-get install module-init-tools but I am not savvy enough with creating deb files to add it to a dep for just debian and not ubuntu.

I was incorrect. You should not need anything extra. Please try 6.10 for debian/ubuntu here: http://repo-ck.com/bench/profile-sync-daemon_6.10-1_all.deb

It works fine on my VM running 8.2.0.

jonpolak commented 9 years ago

module-init-tools is deprecated. Transitioned to kmod.

On 13 September 2015 at 00:24, graysky notifications@github.com wrote:

Yes. Note that I just checked in a VM and 8.2.0 does not provide modinfo out-of-the-box which is needed. You can install it via apt-get install module-init-tools but I am not savvy enough with creating deb files to add it to a dep for just debian and not ubuntu.

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-139848751 .

graysky2 commented 9 years ago

Yeah, I figured that out... that's why I edited the post with strikeout text :stuck_out_tongue_closed_eyes:

Anyway, built up kernel version 4.2 on my debian 8.2.0 VM and found that everything with overlayfs works as expected. I think it's safe to close this issue.

jonpolak commented 9 years ago

with respect to the sudoers addition: user_alias ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper

is it possible to run /usr/bin/psd-overlay-helper with MNT or something other than root? Would it make sense defining a new group with the custom access required?

On 17 September 2015 at 13:56, graysky notifications@github.com wrote:

Yeah, I figured that out... that's why I edited the post with strikeout text [image: :stuck_out_tongue_closed_eyes:]

Anyway, built up kernel version 4.2 on my debian 8.2.0 VM and found that everything with overlayfs works as expected. I think it's safe to close this issue.

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-141226184 .

jonpolak commented 9 years ago

Documentation unclear:

Without the bold, the timers would not be set.

systemctl --user start psd.service systemctl --user start psd-resync.timer

systemctl --user enable psd.service

The documentation says only to start psd.service -

On 17 September 2015 at 22:15, Jonathan Polak jpolak@gmail.com wrote:

with respect to the sudoers addition: user_alias ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper

is it possible to run /usr/bin/psd-overlay-helper with MNT or something other than root? Would it make sense defining a new group with the custom access required?

On 17 September 2015 at 13:56, graysky notifications@github.com wrote:

Yeah, I figured that out... that's why I edited the post with strikeout text [image: :stuck_out_tongue_closed_eyes:]

Anyway, built up kernel version 4.2 on my debian 8.2.0 VM and found that everything with overlayfs works as expected. I think it's safe to close this issue.

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-141226184 .

graysky2 commented 9 years ago

Actually the man page states, "Psd ships with a systemd user service to start or stop it (psd.service). Additionally, a provided resync-timer will run an hourly resync from tmpfs back to the disk. The resync-timer is started automatically with psd.service so there is no need to attempt to start the timer."

I provide three systemd units: psd.service psd-resync.timer psd-resync.service

You start psd.service and the resync.{timer,service} get started automatically. They both stop when you stop psd.service.

graysky2 commented 9 years ago

As to your question about the overlay-helper, I could use udisks but that would add an additional dependency although you could argue that [udisks] is likely present on the system anyway.

jonpolak commented 8 years ago

I'm finding that my google-chrrome profile is not syncing and that no backups have been created.

Here is psd.conf followed by psd p followed by systemctl --user list-timers --all

[image: Inline images 5] Perhaps it's because the timer is not being set? I'm on PSD 6.10

graysky2 commented 8 years ago

I can't see the image. Can you post the output of psd p via text?

Also, 6.11 is out which offers a few speedups: https://github.com/graysky2/profile-sync-daemon/compare/v6.10...v6.11

You can get the deb from: http://repo-ck.com/bench/profile-sync-daemon_6.11-1_all.deb

jonpolak commented 8 years ago

https://drive.google.com/file/d/0B9p4ixWY8D7yVDItS0xrWUZONHhIT0lMN1RpQV9ISWczcUow/view?usp=sharing

On 20 September 2015 at 23:59, graysky notifications@github.com wrote:

I can't see the image. Can you post the output of psd p via text

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-141894869 .

graysky2 commented 8 years ago

I'm not sure why your psd-resync.service isn't starting automatically. How are you starting psd?

jonpolak commented 8 years ago

I started PSD like this:

systemctl --user start psd systemctl --user enable psd

So psd.service does start automatically - but the resync service never does unless I manually set the timers

On 21 September 2015 at 14:16, graysky notifications@github.com wrote:

I'm not sure why your psd-resync.service isn't starting automatically. How are you starting psd?

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-142110409 .

graysky2 commented 8 years ago

For me (Debian 8.2.0 in a VM), the resync service does indeed start with psd.service as it should. Can you try the following:

1) Stop psd (systemctl --user stop psd) 2) Update to 6.11 (http://repo-ck.com/bench/profile-sync-daemon_6.11-1_all.deb) 3) Refresh your services systemctl --user daemon-reload 4) Start psd systemctl --user start psd 5) Verify that the resync service started psd p

jonpolak commented 8 years ago

Apologies for the delay - the link you provided above is 404.

I'll git pull it and report back on Sunday. Have you considered using checkinstall http://www.asic-linux.com.mx/~izto/checkinstall/ instead of make install? Any reason to AVOID using checkinstall?

On 22 September 2015 at 22:42, graysky notifications@github.com wrote:

For me (Debian 8.2.0 in a VM), the resync service does indeed start automatically. Can you try the following:

1) Stop psd (systemctl --user stop psd) 2) Update to 6.11 ( http://repo-ck.com/bench/profile-sync-daemon_6.11-1_all.deb) 3) Refresh your services systemctl --user daemon-reload 4) Start psd systemctl --user start psd 5) Verify that the resync service started psd p

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-142499273 .

jonpolak commented 8 years ago

SUCCESS

6.11.1 starts the timers correctly!

Profile-sync-daemon v6.11.1 on SolydXK

Systemd service is currently active. Systemd resync-timer is currently active. Overlayfs v23 is currently active.

Psd will manage the following per /home/joni/.config/psd/psd.conf:

browser/psname: google-chrome/chrome owner/group id: joni/1000 sync target: /home/joni/.config/google-chrome tmpfs dir: /run/user/1000/joni-google-chrome profile size: 590M overlayfs size: 70M recovery dirs: none

On 24 September 2015 at 22:19, Jonathan Polak jpolak@gmail.com wrote:

Apologies for the delay - the link you provided above is 404.

I'll git pull it and report back on Sunday. Have you considered using checkinstall http://www.asic-linux.com.mx/~izto/checkinstall/ instead of make install? Any reason to AVOID using checkinstall?

On 22 September 2015 at 22:42, graysky notifications@github.com wrote:

For me (Debian 8.2.0 in a VM), the resync service does indeed start automatically. Can you try the following:

1) Stop psd (systemctl --user stop psd) 2) Update to 6.11 ( http://repo-ck.com/bench/profile-sync-daemon_6.11-1_all.deb) 3) Refresh your services systemctl --user daemon-reload 4) Start psd systemctl --user start psd 5) Verify that the resync service started psd p

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/128#issuecomment-142499273 .

graysky2 commented 8 years ago

Cool, glad everything is copacetic. I pushed 6.11.1 to my PPA as you have seen. Enjoy.