Since this is becoming the standard for solving problems with
cron, let me create a specific but sophisticated version: if you are trying to create a GUI program
cron to control from code> , you probably did it wrong.
An acceptable symptom is getting error messages when
DISPLAY is not set or the task’s
cron process cannot access the display directly.
In this brief description, what does it mean, the program you are trying to run is trying to display something on an X11 (or Wayland, etc.) screen and fails because
cron just doesn’t tied to a graphical earth atmosphere or any I/O device type, as well as the ability to read and write directories and send emails if the feature allows it.
For the current goal “I can’t run my
cron job graphically”, let’s just describe six common scenarios for this problem.
You probably know more about the case you are trying to implement in order to implement it and research the questions you are in.Walk in this particular scenario to find out more and find solutions from real code in real.
If you’re having trouble developing an interactive program that talks to the user, you need to rethink https://cronlive.com approach. A common but non-trivial scheme is to divide a program into two parts: an internal part, which can also be run by
cron, but without any interactive means visible to the user, and an external part, which the user executes from of its GUI when it wants to contact a back-end service.
Perhaps your client client should just be added via a user startup GUI script, assuming it should start automatically or they want it to start at login.
I’m guessing that a backend provider that can be started via
cron, if it needs a GUI, can start that one instead, which is used by the X11 boot server batch programs; but it is, if not, then you are probably running it from the st Standard software download (currently
/etc/rc.localor a very system-like launch directory that plays well) traditionally.1
If you try to run one GUI program that interacts without interacting with the real user 2, you run the risk of configuring this “headless” X11 server 3< again and again. sup > and run a
cronjob, which the upstream server will run, run your job, and then exit.
Your job should probably just run a server-ready
cronfor (a separate x11 by any interactive X11 server, which often hosts the actual physical displays or graphics cards connected at keyboard time (s available) on the system), and in this situation, the configuration is passed, which usually starts the clients you want to start as soon as they are up and running. Also (See the next paragraph for some rational considerations.)
You are using your computer for the sole purpose of displayingHave the best interface in a GUI application and then want to run this program when you start your computer.
At first your scripts should probably just launch (an X11 GUI or something like that) and hook into their startup script to similarly programmatically launch the client after the entire GUI is up and running. In other words, you don’t need
cronhere; Simply configure the enterprise startup scripts to run in the desktop and desktop GUI configure the desktop GUI to launch your application as part of the auto-login name sequence (presumably guest?)4 < /p >
There are ways to run x11 programs in the system’s display center (
DISPLAY=:0.0), but according to experts, claims display is generally reserved for possible interactive use by a user who logs in and runs the latest version of the graphical desktop. tends to backfire as wellIt doesn’t scale very well.
An added complication is knowing which one the user decides to run this
cron as a job. A good system resource like backend can blueprint, and should probably be
root to execute (although it should ideally have a fully dedicated system account, which it will change once it has access to all privileged the resources he needs). ), that’s it, but anything related to GUI definitely can’t be run just because
root at some point.
A related and entirely different question is how to interact meaningfully with the user. If you can identify a user’s busy session (since that value is well-defined even a priori), how can you get that attention without interfering with what they’re doing with something new? But more importantly, how do people find them? So you’re probably not connected to most of them, are you? If so, how do you determine how often they are active and available? If you have logged in more than once, whichThe feature you are using and is it safe to end this session? If you’re connected to a GUI, you may miss the new window on the local console when you’re actually connected via VNC or a remote X11 server.
Alternatively, for concentrated servers (web hosting services, groups, and tons of supercomputers, etc.), you can even remove the terms of service from the hosting institution, or install an interactive graphical desktop that your whole family can access due to outside of the house. peace or not at all.
cron is a way for regular users who have no other way to run something on system boot, but it’s just awkward and obscure to hide something- then. when you are definitely
root and have full control of the system. Use function configurations to start system services.
The other is always poorly designed academic or office software that is not meant to be written and therefore requires a single graphical even interface if you just want to run a batch job and complete it quickly without displaying anything anywhere.< /p >
(In case of delay, if there is no
--batch full or
--headless, maybe check registration or < code>–script or a similar option
--eval, or to run a GUI without tools, or may be a standalone utility due to non-interactive use .)
Xvfb is Il Delaware’s de facto standard solution; starts a “virtual framebuffer” in which the computer resets the pixels as if it were displaying them, but it’s not really related to any of the Tony’s display hardware.
Here eThere are several options.
The easiest way is to set the system to automatically login for a specific user without entering a password, and also set that desktop user’s locale (Gnome, KDE, XFCE, or similar) to run the script from his “Launch Items” movie.” and/ or “Login Actions” or “Autostart” or any other settings.If users need more control over the market, maybe X11 start without a pretty desktop environment window or handler if that’s all and just run your illegal program instead Or perhaps in some cases, remove and replace the X11 (“Welcome”) login handler with something else.