“В start job is running for / и т.д. / rc.local Compatibility”: how to fix?

I just upgraded to Убунту Вивид (15.04) today, and after the restart I experienced в very long boot process. My laptop usually boots in 5 seconds or less, and now it hadn't finished even after в few minutes.

Прессинг Esc showed the following screen:

enter image description here

The last line says "В start job is running for / и т.д. / rc.local Compatibility (7 min 24s / не limit)". Despite the "не limit" part, it gave up (or completed?) after exactly 10 minutes, and the boot process finished.

This happens on every boot.

Could it be related to the transition to systemd? How хан I fix this? (Right now, I think twice before shutting down my laptop). Should I доклад в вирус? And if so, where?

My /etc/rc.local file:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
fstrim -v /
fstrim -v /home
exit 0

The file is executable:

$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 333 aug 14  2013 /etc/rc.local

I added the 2 fstrim lines almost 2 years ago, when I installed в SSD, following the instructions from Эаси Линукс tips project.

Apparently these пахал the вызовите of my problem (I переместите them and rebooted - the problem was gone), but I still think the system shouldn't hang like that for 10 minutes. Also, how хан I run fstrim at boot now?

4
задан 24 June 2015 в 13:07

3 ответа

При помещении продолжительных команд в rc.local запуск будет задержан. Необходимо отправить их в фон:

( fstrim -v /; fstrim -v /home ) &

Однако Вы, вероятно, не должны делать этого сами. Ubuntu 14.10 добавил еженедельное задание для fstrim .

6
ответ дан 1 December 2019 в 09:03

Странный, что это внезапно - проблема в Ubuntu 15.04, тогда как он всегда работал хорошо на Вас в Ubuntu 14.04....

Вы могли бы также добавить параметр сна перед обрезкой, так, чтобы две команды для обрезки были выполнены после числа набора секунд. Это должно позволить процессу начальной загрузки завершаться, заставив команды для обрезки быть выполненным в фоновом режиме.

Как это (задержка 40 секунд):

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 40
fstrim /
fstrim /home
exit 0

-v (подробный) параметр для обрезки имеет в этом случае быть бесполезное, между прочим, потому что это выполняется в фоновом режиме. Я изменил это в своем практическом руководстве Easylinuxtips также.

Примечание: я только протестировал такой параметр сна в rc.local в Ubuntu 14.04 и Linux Mint 17.x (для другой цели, чем обрезка), таким образом, я не уверен, будет ли это работать так же в Ubuntu 15.04.

2
ответ дан 1 December 2019 в 09:03

У меня была та же проблема, в основном это происходит, когда что-то в rc.local обычно не завершается, такие как какой-то демон. Для нахождения, какая команда в rc.local является преступником просто к killall,-9 command/from/etc.local и это перезагрузят, после того как все команды от rc.local завершаются.

1
ответ дан 1 December 2019 в 09:03

Другие вопросы по тегам:

Похожие вопросы: