Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Rozwiązane trim nie dzała na partycji home
#11
0
(18-12-2020, 10:04)dedito napisał(a): https://www.freedesktop.org/software/sys....exec.html
Cytat:ProtectHome=

    Takes a boolean argument or the special values "read-only" or "tmpfs". If true, the directories /home/, /root, and /run/user are made inaccessible and empty for processes invoked by this unit.
If set to "read-only", the three directories are made read-only instead. If set to "tmpfs", temporary file systems are mounted on the three directories in read-only mode. The value "tmpfs" is useful to hide home directories not relevant to the processes invoked by the unit, while still allowing necessary directories to be made visible when listed in BindPaths= or BindReadOnlyPaths=.

    Setting this to "yes" is mostly equivalent to set the three directories in InaccessiblePaths=. Similarly, "read-only" is mostly equivalent to ReadOnlyPaths=, and "tmpfs" is mostly equivalent to TemporaryFileSystem= with ":ro".

    It is recommended to enable this setting for all long-running services (in particular network-facing ones), to ensure they cannot get access to private user data, unless the services actually require access to the user's private data. This setting is implied if DynamicUser= is set. This setting cannot ensure protection in all cases. In general it has the same limitations as ReadOnlyPaths=, see below.

    This option is only available for system services and is not supported for services running in per-user instances of the service manager.
Na początek ustawiłbym ProtectHome=no
I co dalej?
#12
0
Nie bardzo rozumiem, uruchamiasz usługę i patrzysz w logi?
#13
0
(18-12-2020, 10:29)dedito napisał(a): Nie bardzo rozumiem, uruchamiasz usługę i patrzysz w logi?
kazałeś mi przestawić z yes na no ProtectHome i pytam się co dalej bo nie za bardzo na razie się znam
#14
0
Myślałem, że to oczywiste, że po zmianie parametru usługę należy uruchomić i sprawdzić czy działa zgodnie z oczekiwaniami Smile
#15
0
(18-12-2020, 10:38)dedito napisał(a): Myślałem, że to oczywiste, że po zmianie parametru usługę należy uruchomić i sprawdzić czy działa zgodnie z oczekiwaniami Smile
Ja sobie ustawiłem że by mi to czyściło codziennie, a jaką komendę sprawdzić to?
#16
0
Standardowo z poziomu systemd
Kod:
systemctl start fstrim.service
, ale z powodu parametru quiet nic nie zobaczysz więc ja bym uruchomił jako root z palca zgodnie z tym co masz w ExecStart=/sbin/fstrim --fstab --verbose --quiet ale bez opcji quiet
Jak masz codziennie to możesz też sprawdzić kiedy nastąpi kolejny start usługi (patrz linijka trigger):
Kod:
systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/lib/systemd/system/fstrim.timer; disabled; vendor preset:>
     Active: active (waiting) since Fri 2020-12-18 09:30:32 CET; 21min ago
    Trigger: Mon 2020-12-21 01:26:01 CET; 2 days left
   Triggers: ● fstrim.service
       Docs: man:fstrim
#17
0
(18-12-2020, 10:50)dedito napisał(a): Standardowo z poziomu systemd
Kod:
systemctl start fstrim.service
, ale z powodu parametru quiet nic nie zobaczysz więc ja bym uruchomił jako root z palca zgodnie z tym co masz w ExecStart=/sbin/fstrim --fstab --verbose --quiet ale bez opcji quiet
Jak masz codziennie to możesz też sprawdzić kiedy nastąpi kolejny start usługi (patrz linijka trigger):
Kod:
systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/lib/systemd/system/fstrim.timer; disabled; vendor preset:>
     Active: active (waiting) since Fri 2020-12-18 09:30:32 CET; 21min ago
    Trigger: Mon 2020-12-21 01:26:01 CET; 2 days left
   Triggers: ● fstrim.service
       Docs: man:fstrim
Uruchomiłem jako root tą komendę systemctl start fstrim.service bez --quiet i wyskoczyło takie coś
Kod:
Job for fstrim.service failed because the control process exited with error code.
See "systemctl status fstrim.service" and "journalctl -xe" for details.
#18
0
Napisz co dokładnie wpisałeś i co wyskoczyło, bo z powyższego nie wiele rozumiem.
#19
0
(18-12-2020, 11:22)dedito napisał(a): Napisz co dokładnie wpisałeś i co wyskoczyło, bo z powyższego nie wiele rozumiem.
wpisałem komendę w terminalu jako root: systemctl start fstrim.service i pokazało
Kod:
Job for fstrim.service failed because the control process exited with error code.
See "systemctl status fstrim.service" and "journalctl -xe" for details.
#20
0
To teraz czytasz i wykonujesz co podpowiada system (dowiesz się dzięki temu, czemu usługa nie startuje):
Kod:
Job for fstrim.service failed because the control process exited with error code.
See "systemctl status fstrim.service" and "journalctl -xe" for details.
Czyli to co pisze w drugiej linijce.
Czyli wpisujesz
Kod:
systemctl status fstrim.service
i wklejasz wynik.
Oraz wpisujesz
Kod:
journalctl -xe
i wklejasz wynik, ale tu może być sporo informacji więc może samo
Kod:
journalctl -xe | tail

Ja u siebie odpaliłem i doszłem do wniosku, że złą usługę odpalamy, bo to miała być fstrim.timer
Generalnie tak jak pisałem uruchom ręcznie jako root to co masz w ExecStart=/sbin/fstrim --fstab --verbose --quiet ale bez opcji quiet, czyli:
Kod:
sudo /sbin/fstrim --fstab --verbose


Skocz do:




Użytkownicy przeglądający ten wątek: 1 gości