2

I created an init-script that should push some log files using s3cmd to an Amazon S3 bucket when the system is going down. s3cmd is installed and s3cmd --configure was run as user root and the configuration is OK

When manually executing the init script, it does the job but when it is executed by init during a shutdown, it fails.

What can be the reason? What is different when the init-script is run by init? Maybe it cannot read the /root/.s3cfg file?

Please advise.

marekful
  • 173

1 Answers1

2

The assumption about s3cmd not being able to read its config file was right. For some reason unknown to me, during runlevel change (0), when init executes init-scripts, apparently the root user who does run those scripts doesn't count as a "real" user so it doesn't have a "home" directory from where s3cmd tries to read the config.

Explicitly specifying the config file's location using the --config=... solves this problem.

marekful
  • 173