Skip to content

Allow execution without cron/crontab present #2245

@m4rcu5

Description

@m4rcu5

Describe the problem, feature or ask a question:

Hiya,

Let me start of by acknowledging that I have done my research trough other issues, and I totally respect your position that cron is the scheduler and there is no support for systemd-timers, as you also stated in #1741.

I did notice that a lot of internal functions with regards to cron and crontab do fail graceful informing the user that you should install/start cron if they want scheduling to work (for example in #1761).
Except that you cannot run BIT when there is no contab or fcrontab command installed due to the following section:

def _determine_crontab_command() -> str:
"""Return the name of one of the supported crontab commands if available.
Returns:
(str): The command name. Usually "crontab" or "fcrontab".
Raises:
RuntimeError: If none of the supported commands available.
"""
to_check_commands = ['crontab', 'fcrontab']
for cmd in to_check_commands:
proc = subprocess.run(
['which', cmd],
stdout=subprocess.PIPE,
check=False
)
if proc.returncode == 0:
return cmd
# syslog is not yet initialized
logger.openlog()
msg = 'Command ' + ' and '.join(to_check_commands) + ' not found.'
logger.critical(msg)
raise RuntimeError(msg)

Patching it out, and setting CRONTAB_COMMAND to /bin/false seems to make BIT run as expected (sans the scheduling features) and I have backed up my machine without issues.

My request would be if it would be possible to let BIT execute without a dependency on crontab. Or ideally grey-out/lock-out the scheduling gui parts when there is not crontab available.

Just to clarify, I don't "run arch, btw", but OpenSUSE Tumbleweed, which also by default does not come with cron or crontab, nor does it come with any compatibility layer. They now seem to rely completely on timers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Externaldepends on others/upstreamFeaturerequests a new featureSchedulingcron, anacron etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions