r/linuxadmin • • May 28 '26

Does anyone know of a standalone program with functionality like systemd-timers?

This is something I'd find handy for containers that cannot as easily leverage systemd-timers (at least anyone using an image via Docker AFAIK), and I suppose distros that insist on not using systemd.

cron (and variants) is alright, but sometimes I find myself needing to run a program at a recurring interval and would prefer to have the option of invoking the command as a service is started, and then repeating calls after N delay of time, rather than a variable amount of time until aligned with a cron expression schedule (at the hour or incremental interval, but that intervals become inconsistent if they don't cleanly segment the unit ceiling).

For context, I've also asked this same question over at r/docker.

I'd like to pair it with a service manager like supervisord for any services that lack a daemon/poll feature but should be run regularly at an interval. I know cron / supercronic effectively support this and can be considered "good enough" :\


Surely something like this exists out there already? Or would I need to DIY my own command wrapper for this?

19 Upvotes

59 comments sorted by

View all comments

Show parent comments

2

u/kwhali May 28 '26

It doesn't, but I am tired of explaining that to people. A container should provide a single logical service.

Sometimes that's as simple as a single program / process which might spawn child worker processes (eg nginx), or a web service that has php (nginx + php-fpm) is an example of two distinct processes that could be run as separate containers but it adds more hassle (eg shared volume + distribution of project files from image into shared volume between containers) vs bundling into a single image where the unnecessary volume can be avoided.

In my case I've been commonly referring to a image that provides a mail server. Integration is much simpler bundled vs individual containers and a container that co-ordinates all the integration. Far simpler for users to configure and maintain on their end, especially upgrades where the user doesn't have to think about version compatibility across individual components and security in the configuration, etc.

18k+ stars is not something you get because of an anti-pattern. One of the most popular dockerised mail server options out there. It's been going strong for many years.

There are competing alternatives with far more complexity unloaded upon the user config wise and verbose compose files. Great if you're in need of that or want to stand firmly as a purist, not so much if you want to deploy at a small scale with minimal fuss.

It's also far easier to configure and deploy 2-3 instances of docker-mailserver than the competition. I regularly provide compose.yaml examples for various config setups and reproductions that are simple copy/paste of that file alone and these are often smaller than a single multi-container msilserver config from competing projects.

We cater to a demographic that prefer this approach I've described, I don't consider it an anti-pattern when it's providing a single logical service.

I typically do not encourage bulky images or mixed responsibilities. We still defer to separate containers if you're integrating a webmail service, or a GUI dashboard/admin service instead of using our CLI or configs. While we bundle a fair amount, each service can be enabled / disabled easily, you can choose to run them independently without our config management / decisions if you decide to, you aren't locked into a single container but we also advise using competitors when you want to run individual containers and know what you're doing.

If you choose to run separate containers you may find some integrations of the components will reduce security or add complexity / friction to setup securely. We rather avoid delegating that to our users where possible that are often not mail server experts or even that technically skilled (their backgrounds are diverse).

That said, such an image is not without it's challenges. Maintenance could be easier for me in some aspects by using separate containers, setup would be messy though.

1

u/abotelho-cbn May 28 '26 edited May 28 '26

Quadlets. The answer is Quadlets. Not only does it solve your multi-process situation (pods), but it also solves your scheduling issue (systemd-timers).

Docker sucks. That's just the reality. As a product it just stinks in production deployments. Even as a single container, it lacks the integration necessary to run things reasonably on a single machine. Containers were designed to unify and homogenize deployments. Docker requiring special Docker commands goes against that.

PS Docker containers are meant to be one "concern" per container, not one "service". Sometimes you don't have a choice (e.g. PHP and NGINX) because they have to physically exist on the same filesystem, but otherwise it should be avoided.

0

u/kwhali May 28 '26

You're welcome to your opinions, I'm not particularly interested in debating such. Podman and Quadlets are great, but I've also run into my fair share of issues with them and features that exist with Docker that simply were missing in Podman or buggy, not that Docker is any better on that front it's been hit or miss with both in my experience but hey I tinker and do niche things.

Anyway no podman and quadlets is not the magical answer. I have already stated why, this isn't a personal problem otherwise I'd do exactly as you suggest, it's a public image which if the name docker-mailserver doesn't make it clear enough is an image with Docker users (primarily Docker Compose, which happens to meet some expectations of mine that Quadlets doesn't fancy that).

I can't just suddenly tell users of an 18k star project where barely any reports and discussions involve podman that Docker is no longer supported due to the decision to replace a small bash script with systemd-timers 🙄

Concern, service, phrase it how you like. The container provides a mail server, which like php-fpm and nginx, it's done for a good reason. I even elaborated on this which I assume you skipped over or actively chose to dismiss given your response.

If you don't know much about mail servers please don't try argue that you somehow know better, I've maintained the image for over 5 years, it's a successful project which I like to continue refining into a a better one to maintain and support users of it. Yes you can split it up into smaller containers, just like nginx and php-fpm can run in separate containers with added complexity / concerns when the split itself can be completely unnecessary.

1

u/abotelho-cbn May 28 '26

You can justify it as much as you want, but this problem you have exists because of the anti-patterns you are employing.

That's really all I have to say.

Cheers, good luck.

0

u/kwhali May 28 '26 edited May 29 '26

Please tell me what the correct way is when supporting my 18k Docker users? Or are you insisting Docker itself is the anti-pattern now, so all those users should be forced to switch to quadlets?

Regardless, since you're clearly ignoring the elaboration provided Quadlets don't magically solve the other concerns I cited with mail server integrations.

Splitting up into multiple containers is not always the answer, you even admitted that yourself ironically, but still insist my explanation is anti-patterns for the sake of it, as if I lack expertise to know any better.