If it works when run manually, but fails via systemd, then you should post your service file.
Helping one another out is invisibilized, not rare. A good chunk of what I know comes from other people taking the time to explain why something works the way it does and how you can see that for yourself. The rest is from curiosity, experimentation, and hammering away at something until it fits. It's not professionally specialized knowledge.
But those kinds of initialisations belong in .profile
(or, if you're using a weird desktop environment, its own configuration file), particularly if you want .desktop
files to work. (In .bashrc
, PATH
will grow longer in each subshell, which shouldn't cause problems but is wasteful.)
So, what desktop environment (GNOME, KDE, Cinnamon, etc.) are you using?
.profile
is executed by login shells for the benefit of it and its subshells, and by DEs like Cinnamon for the benefit of .desktop
launchers at login.
So, have you logged out and back in again since adding these lines to .profile
?
And of course, the .profile
has to be executed properly for its configuration to take effect, so it`s useful to know if the problem is with those specific lines, or the file as a whole.
Add:—
date >> ~/profile-execution-log-top.txt
echo $PATH >> ~/profile-execution-log-top.txt
to the top of .profile
, and:—
date >> ~/profile-execution-log-end.txt
echo $PATH >> ~/profile-execution-log-end.txt
to the bottom of .profile
(use alternative paths as you see fit) to monitor that activity. You can test this by sourcing .profile
but the real test is logging out and in again. Look at the time when you do this so you can correlate each action with each timestamp in the log files. If .profile
is executed to completion, you should have two files with matching timestamps but different PATH
s. If you don't have a matching timestamp in the "end" log file, there's a problem mid-execution. If neither file is being updated, .profile
isn't being executed at all.
Since .bashrc
is executed for all non-login shells, it shouldn't really source .profile
, which is only meant for login shells, and might trigger expensive activity. (.profile
might source .bashrc
, but that`s fine.)
Shouldn't you be more wary of the unexpected, Redshirt?
Having thought about this some more with practicality and clarity thrown out the window in favour of abstractions, how about this?
A game is a sequence of moves. Past moves are immutable, future moves unknowable; a singly linked list fits the bill here.
Each move consists of a player token and a position. The position might ordinarily be thought of as a grid index but, as you point out, it could just as well be membership in one of the potentially winning lines. Either a move is part of one of these lines or it isn't. This makes the position equivalent to a bit field. If each potential win line is distinct, they could indeed be held sparsely in a set.
Checking for a win then consists of counting player tokens for each potential win line and checking for crossing the necessary threshold. Filter, sum, max, greater than?, any?
I think this scheme would be applicable to arbitrary game boards, with none of it requiring mutation. Is that the kind of thing you were after? The reflection/rotation equivalence isn't present here, but I still think that's more an artefact of analysis, rather than a property of gameplay.
The output here lets us know that systemd is running the service file and starting the script just fine. The echoed GPU temperature is making it to the journal, but the
gpuTemp
variable isn't being updated (staying at0
) because of a problem executingnvidia-settings
. Specifically, it wants a display: "The control display is undefined
".You could add a line to the service file:—
Although if
echo DISPLAY
in your terminal gives you a different value, use that. There's a possibility that that will just push one error further down the line, but it's something to try.Alternatively/additionally, you could try changing the
User=
line to your own username to see if it picks up the environment your manual executions work with.You aren't the only one to run into problems trying to automate
nvidia-settings
. You might end up needing to track down anXauthority
file or use the display manager's initialisation options.