Mi máquina consume toda la CPU durante una o dos horas procesando algunas estadísticas del sistema. Hasta ahora he resuelto ese problema limpiando la enorme cantidad de datos en /private/var/db/systemstats/
Ahora me he dado cuenta de que obtengo toneladas de archivos .stats creados en /var/log/com.apple.launchd.peruser.94
. Se crea un nuevo archivo cada 20 segundos. Una lista se ve así:
bash-3.2# ls -lt
total 136
-rw------- 1 _teamsserver wheel 268 May 14 09:38 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.rt0Fz3.stats
-rw-r--r-- 1 _teamsserver wheel 16289 May 14 09:38 launchd-shutdown._teamsserver.log
-rw-r--r-- 1 _teamsserver wheel 16487 May 14 09:38 launchd-shutdown._teamsserver.log.1
-rw------- 1 _teamsserver wheel 268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.gJFx9e.stats
-rw------- 1 _teamsserver wheel 268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.dE601a.stats
-rw------- 1 _teamsserver wheel 268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.v3CH6Y.stats
-rw------- 1 _teamsserver wheel 268 May 14 09:37 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.89LBZP.stats
-rw------- 1 _teamsserver wheel 268 May 14 09:36 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.CO28zM.stats
-rw------- 1 _teamsserver wheel 268 May 14 09:36 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.FDGR7H.stats
-rw------- 1 _teamsserver wheel 268 May 14 09:35 3FCE2CE8-4834-4A2E-ADBA-47BCFCC92A9B.launchd.events.1SJEPv.stats
bash-3.2#
¿Qué está causando esto?
Estoy ejecutando Mavericks 10.9.5 con OSX Server 3.1.2.
EDITAR:
La ejecución de este ps -u _teamsserver
produce esta salida:
UID PID TTY TIME CMD
94 258 ?? 597:58.63 /usr/bin/python /Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres -D /Library/Server/Wiki/Database.xpg/Cluster.pg -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directory=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on
94 262 ?? 4:45.21 /Applications/Server.app/Contents/ServerRoot/usr/bin/postgres_real -D /Library/Server/Wiki/Database.xpg/Cluster.pg -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directory=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on
94 263 ?? 1:03.79 /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_receivexlog -h /Library/Server/Wiki/PostgresSocket --no-password --directory /Library/Server/Wiki/Database.xpg/backup --verbose
94 264 ?? 0:25.33 postgres: logger process
94 266 ?? 0:53.21 postgres: checkpointer process
94 267 ?? 1:20.23 postgres: writer process
94 268 ?? 1:15.03 postgres: wal writer process
94 269 ?? 2:55.69 postgres: autovacuum launcher process
94 270 ?? 0:24.03 postgres: archiver process last was 0000000100000000000000E8
94 271 ?? 7:29.90 postgres: stats collector process
94 279 ?? 23:24.36 /Applications/Server.app/Contents/ServerRoot/usr/sbin/collabd
94 281 ?? 0:42.81 postgres: collab collab [local] idle
94 292 ?? 0:00.00 postgres: collab collab [local] idle
94 309 ?? 2:04.84 postgres: wal sender process _teamsserver [local] streaming 0/E9B06448
94 38417 ?? 0:01.39 /Applications/Server.app/Contents/ServerRoot/usr/bin/ruby notifications.rb
A veces aparece otra línea que corresponde al intervalo de 20 segundos:
94 44867 ?? 0:00.01 /sbin/launchd
EDITAR:
Comencé launchctl
y miré algunos comandos y resultados. El comando list
mostró esto:
...
263 - 0x7f96d2d27200.anonymous.pg_receivexlog
258 - 0x7f96d2c68620.anonymous.Python
- 0 com.apple.launchd.peruser.94
215 - 0x7f96d2d19890.anonymous.postgres_real
216 - 0x7f96d2d194c0.anonymous.pg_receivexlog
...
Listado de la entrada peruser.94 varias veces da esto: (una vez con una entrada PID, una vez no)
launchd% list com.apple.launchd.peruser.94
{
"Label" = "com.apple.launchd.peruser.94";
"LimitLoadToSessionType" = "System";
"OnDemand" = true;
"LastExitStatus" = 0;
"TimeOut" = 30;
"Program" = "/sbin/launchd";
"EnableTransactions" = true;
"MachServices" = {
"com.apple.launchd.peruser.94" = mach-port-object;
};
};
launchd% list com.apple.launchd.peruser.94
{
"Label" = "com.apple.launchd.peruser.94";
"LimitLoadToSessionType" = "System";
"OnDemand" = true;
"LastExitStatus" = 0;
"PID" = 45918;
"TimeOut" = 30;
"Program" = "/sbin/launchd";
"EnableTransactions" = true;
"MachServices" = {
"com.apple.launchd.peruser.94" = mach-port-object;
};
};
Supongo que debería poder seguir la ruta a lo largo de "MachServices", etc. Pasaré algún tiempo buscando en la documentación. ¿Alguien puede darme algunos consejos sobre a dónde podría llevar esto? ¿Cómo puedo averiguar qué intenta hacer esto?
EDITAR:
Busqué todas las entradas en /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons
que contengan "_teamsserver":
bash-3.2# pwd
/Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons
bash-3.2# grep -i teams *
com.apple.collabd.expire.plist: <string>_teamsserver</string>
com.apple.collabd.expire.plist: <string>_teamsserver</string>
com.apple.collabd.preview.plist: <string>_teamsserver</string>
com.apple.collabd.preview.plist: <string>_teamsserver</string>
com.apple.collabd.quicklook.plist: <string>_teamsserver</string>
com.apple.collabd.quicklook.plist: <string>_teamsserver</string>
com.apple.collabd.stats.plist: <string>_teamsserver</string>
com.apple.collabd.stats.plist: <string>_teamsserver</string>
com.apple.xcs.stats.plist: <string>_teamsserver</string>
com.apple.xcs.stats.plist: <string>_teamsserver</string>
com.apple.xcsbuildd.plist: <string>_teamsserver</string>
com.apple.xcsbuildd.plist: <string>_teamsserver</string>
com.apple.xcsdevicesnifferd.plist: <string>_teamsserver</string>
com.apple.xcsdevicesnifferd.plist: <string>_teamsserver</string>
bash-3.2#