SimFactory problems when running from cron

Create issue
Issue #887 wontfix
Ian Hinder created an issue

When running from a cron job, the user's profile has not been set up in the usual way. I have to source /etc/profile on Datura to get things like qsub and qstat on the path. Should simfactory do something about this?


Comments (2)

  1. Erik Schnetter
    • removed comment

    "sim --remote X ..." usually loads a different than "sim login X; ...". I tend to add code to the "envsetup" MDB entry to correct for this.

    One has to be careful to not just source /etc/profile, since this may overwrite people's setting in their /.profile.

    In your case, I would decide on a case-by-case basis whether to modify envsetup, or whether to source /etc/profile from the cron job.

  2. Roland Haas
    • edited description
    • changed status to wontfix

    Running from a cronjob seems unusual enough that doing so (and getting it right) seems like something that only "experts" will want to do. Those are then expected to set up an environment suitable for simfactory. I would rather have simfactory avoid having support for very many exotic uses. If code depend on $PATH then a solution is to put the full path to qsub etc. into the ini file to eliminate any $PATH dependencies. This also avoids picking up the "wrong" executable if users change their $PATH from what we expect it to be.

    A similar issue also exists when using "ssh" to connect to a OSX system since in that case PATH differs from what one would normally find.

    As far as I can tell sim login does not execute envsetup on the remote side, only on the local side (as part of ExecuteCommand. To my knowledge envsetup is only executed by sim execute (and its internal use by simfactory). sim login tries to mimic what happens by a regular ssh command by executing the shell it starts as a login shell (by passing the -l option), it relies on bash to turn a shell whose stdin is network socket into an interactive shell (ie it does not pass the -i option).

  3. Log in to comment