LoginSignup
9
9

More than 5 years have passed since last update.

Docker内のCronでCannot make/remove an entry for the specified sessionとか言われた時の対処法メモ

Posted at

はじめに

DockerでCronを動かそうとしたら

Cannot make/remove an entry for the specified session

と出て動かなかった時の対処法メモです。

Versionや構成

Docker内のVersionです。

  • CentOS release 6.6 (Final)
  • SupervisordでCronを起動
  • CentOSのベースイメージからそんなにいじってない環境

問題

症状

Cronを実行しようとすると、
/tmp以下に以下のようなログが出ていてCronが実行されていません。

tmp/crond-stderr---supervisor-oAgn26.log
Cannot make/remove an entry for the specified session

対策

のように

/etc/pam.d/crond の pam_loginuid.so をコメントアウトします。

/etc/pam.d/crond
#
# The PAM configuration file for the cron daemon
#
#
# No PAM authentication called, auth modules not needed
account    required   pam_access.so
account    include    password-auth
# session    required   pam_loginuid.so     ← これをこんな風にコメントアウト
session    include    password-auth
auth       include    password-auth

そして sudo service crond restart で crond を再起動します。

さいごに

PAMとかあまりよくわかってなく動けばいいや的な感じでやっているので、
この対処法では問題がある場合はご指摘いただければ幸いです。

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9