Дело было вечером, делать ... А вообще причины начала истории не важны.
Решил на досуге просмотреть логи на одном из подопечных серверов (10.04 LTS), а именно интернет-шлюз в одной конторе с нерегулярным доступом в локалку по OpenVPN. Статического адреса нет, потому для доступа из вне применена система динамических имён. Изначально использовал DynDNS, но ввиду их возросшей жадности и не меньшей её степени в моей сути, недавно переехал на NoIP.
Открываю Putty, выбираю нужный пункт и ... "давай, До свиданья". Понятно - не сработал NoIP. Я "не первый раз замужем", потому на сервере висит аськовский бот, отдающий моему UID IP на внешнем интерфейсе. Запрашиваю и получаю тот же IP, что резольвится по DNS... и следом за мессаджем бот-клиент ICQ на шлюзе уходит в оффлайн. Обана... OpenVPN тоже сказал, что сервер не доступен. Связь окончательно потеряна.
Ну что ж, поехали. "Нубук" © под крылышко и на прогулку. Благо в шаговой доступности и через час неспешной походкой я туплю в экран.
Интернет есть, но OpenVPN и бот Licq также лежат. Пока не до них, сначала надо удалёнку настроить, то бишь ssh, но, скорее всего, уши из одного места торчат.
~$ sudo service ssh status
ssh stop/waiting
Странно
~$ sudo service ssh start
ssh start/running, process 1039
~$ sudo service ssh status
ssh stop/waiting
Ещё интересней. Ну что ж поехали в логи
~$ grep sshd /var/log/syslog.1 | tail
Aug 10 16:35:10 gateway-ns kernel: [ 23.580421] sshd[1039] general protection ip:1c2314 sp:bfff4300 error:0 in libcrypto.so.0.9.8[11d000+138000]
С чего бы это? Память? Диск?
Комп HP 2000 года рождения - всё родное, когда-то был настольным. Вырван из рук варваров, пытающихся его выкинуть из кладовки, во время поиска подходящего железа в качестве шлюза.
Память исключил - не может же именно sshd попадать на один и тот же сегмент памяти. Диск? Но почему эту либу начало корячить?
Приходит мысль: а не было ли обновления?
tail /var/log/apt/history.log
Start-Date: 2014-08-08 06:32:19
Upgrade: libssl0.9.8 (0.9.8k-7ubuntu8.19, 0.9.8k-7ubuntu8.20), openssl (0.9.8k-7ubuntu8.19, 0.9.8k-7ubuntu8.20)
End-Date: 2014-08-08 06:33:01
Было. Гхм... Баг пакета? Наврядли такой косяк попал бы в LTS-релиз
Так как диск не очень большой, а точнее совсем маленький, то все скачанные пакеты удаляются, а значит откатиться на предыдущую версию будет проблематично.
Ну чтож, начнём с простого
sudo apt-get install --reinstall libssl0.9.8
~$ sudo service ssh start
ssh start/running, process 1054
~$ sudo service ssh status
ssh start/running, process 1054
Йоххоу...
~$ sudo service openvpn start
* Starting virtual private network daemon(s)...
* Autostarting VPN server' [ OK ]
~$ sudo service openvpn status
* VPN 'server' is running
Бинго.
Считаю, что причиной проблемы всё же является хромающий диск, но менять не буду... Лень.

Сервис не критичный (бекап давно снят и ждёт своего часа)
Кстати, кто что скажет про смарт-информацию диска?
~$ sudo smartctl -a /dev/sda
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Device Model: QUANTUM FIREBALLlct10 10
Serial Number: 872018834825
Firmware Version: A03.0900
User Capacity: 10 110 320 640 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 4
ATA Standard is: ATA/ATAPI-4 T13 1153D revision 15
Local Time is: Wed Aug 13 09:46:04 2014 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
See vendor-specific Attribute list for failed Attributes.
General SMART Values:
Offline data collection status: (0x84) Offline data collection activity
was suspended by an interrupting command from host.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 1) seconds.
Offline data collection
capabilities: (0x1b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
No Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
No General Purpose Logging support.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 10) minutes.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x0029 100 100 020 Pre-fail Offline - 0
3 Spin_Up_Time 0x0027 081 079 020 Pre-fail Always - 2493
4 Start_Stop_Count 0x0032 093 093 008 Old_age Always - 4712
5 Reallocated_Sector_Ct 0x0033 001 001 020 Pre-fail Always FAILING_NOW 499
7 Seek_Error_Rate 0x000b 100 100 023 Pre-fail Always - 0
9 Power_On_Hours 0x0012 001 001 001 Old_age Always FAILING_NOW 65976
11 Calibration_Retry_Count 0x0013 100 100 020 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 008 Old_age Always - 404
13 Read_Soft_Error_Rate 0x000b 100 100 023 Pre-fail Always - 0
199 UDMA_CRC_Error_Count 0x001a 200 200 000 Old_age Always - 0
196 Reallocated_Event_Count 0x0010 100 253 020 Old_age Offline - 0
197 Current_Pending_Sector 0x0032 100 100 020 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
SMART Error Log Version: 1
ATA Error Count: 13297 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 13297 occurred at disk power-on lifetime: 251 hours (10 days + 11 hours)
When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
04 d9 0d f2 32 7f e0 Error: ABRT 13 sectors at LBA = 0x007f32f2 = 8336114
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 00 00 32 7f e0 00 00:00:41.076 READ DMA
c8 00 00 00 31 7f e0 00 00:00:41.062 READ DMA
c8 00 00 00 30 7f e0 00 00:00:41.048 READ DMA
c8 00 00 00 2f 7f e0 00 00:00:41.024 READ DMA
c8 00 00 00 2e 7f e0 00 00:00:41.008 READ DMA
Error 13296 occurred at disk power-on lifetime: 251 hours (10 days + 11 hours)
When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
10 d1 08 38 1a 82 e0 Error: IDNF 8 sectors at LBA = 0x00821a38 = 8526392
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 38 1a 82 e0 00 00:07:35.527 READ DMA
f8 00 00 00 00 00 e0 00 00:07:35.527 READ NATIVE MAX ADDRESS
ec 00 00 00 00 00 a0 02 00:07:35.519 IDENTIFY DEVICE
ef 03 44 00 00 00 a0 02 00:07:35.512 SET FEATURES [Set transfer mode]
f8 00 00 00 00 00 e0 00 00:07:35.511 READ NATIVE MAX ADDRESS
Error 13295 occurred at disk power-on lifetime: 251 hours (10 days + 11 hours)
When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
10 d1 08 38 1a 82 e0 Error: IDNF 8 sectors at LBA = 0x00821a38 = 8526392
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 38 1a 82 e0 00 00:07:31.208 READ DMA
f8 00 00 00 00 00 e0 00 00:07:31.207 READ NATIVE MAX ADDRESS
ec 00 00 00 00 00 a0 02 00:07:31.199 IDENTIFY DEVICE
ef 03 44 00 00 00 a0 02 00:07:31.192 SET FEATURES [Set transfer mode]
f8 00 00 00 00 00 e0 00 00:07:31.191 READ NATIVE MAX ADDRESS
Error 13294 occurred at disk power-on lifetime: 251 hours (10 days + 11 hours)
When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
10 d1 08 38 1a 82 e0 Error: IDNF 8 sectors at LBA = 0x00821a38 = 8526392
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 38 1a 82 e0 00 00:07:26.872 READ DMA
f8 00 00 00 00 00 e0 00 00:07:26.871 READ NATIVE MAX ADDRESS
ec 00 00 00 00 00 a0 02 00:07:26.863 IDENTIFY DEVICE
ef 03 44 00 00 00 a0 02 00:07:26.856 SET FEATURES [Set transfer mode]
f8 00 00 00 00 00 e0 00 00:07:26.856 READ NATIVE MAX ADDRESS
Error 13293 occurred at disk power-on lifetime: 251 hours (10 days + 11 hours)
When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
10 d1 08 38 1a 82 e0 Error: IDNF 8 sectors at LBA = 0x00821a38 = 8526392
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 08 38 1a 82 e0 00 00:07:22.540 READ DMA
f8 00 00 00 00 00 e0 00 00:07:22.540 READ NATIVE MAX ADDRESS
ec 00 00 00 00 00 a0 02 00:07:22.532 IDENTIFY DEVICE
ef 03 44 00 00 00 a0 02 00:07:22.524 SET FEATURES [Set transfer mode]
f8 00 00 00 00 00 e0 00 00:07:22.524 READ NATIVE MAX ADDRESS
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
Device does not support Selective Self Tests/Logging
P.S. Мне показалось, что топ должен быть в обновлениях, так как проявилось во время обновления. Как бы повествование о "полезности" регулярных обновлений.
