SD Core Solo for Windows WS2.0-0

Running SD

How SD starts, stopping it, the command line, and what to do when the last shutdown was not a clean one.

SD is started by a scheduled task, and it is already running. You do not type sd-solo -start.

Task name SD Core Solo, in Task Scheduler's library
When at every Windows start-up
As whom you — whether or not you are signed in, so ssh and the API work before anyone signs in
With what rights an ordinary, unelevated token, even when your Windows account is an administrator. SD drops the administrator rights itself
Created by the installer, in its one administrator step; registered again by every upgrade
Removed by the uninstaller

There is no Windows service. The multiuser SD Core for Windows ran SD as a service under LocalSystem; Solo runs it as the one user who owns it.

Starting and stopping#

sd-solo -stop
sd-solo -start

Stopping SD ends every session, including API and ssh sessions. Neither needs an elevated window: SD, its data and its programs are yours, and Windows' own protection of your profile is the gate.

Starting it by hand runs it until you stop it or Windows restarts; the task starts it again at the next start-up. Running the task from Task Scheduler does the same thing.

sd-solo -start and sd-solo -stop tell the truth#

"SD is already started" is only said when the daemon really is running, and it gives the Windows process id — the number Task Manager and Stop-Process use.

If SD's shared memory is there but the daemon is not — what a killed or crashed SD leaves behind — sd-solo -start says so and tells you to run sd-solo -stop first. It does not clear it for you, because that would end any sessions still attached; the count of those is printed so you can decide.

sd-solo -stop checks that the daemon actually stopped, and warns with its process id if it did not.

A session still running ten seconds after the stop is ended. sd-solo -stop and sd-solo -restart end it with SIGKILL and say how many they ended, for example 1 process(es) still running after ten seconds were ended with SIGKILL. A process whose program is not in SD's own folder is not touched. A session ended this way does not run its own logout.

Known limit. If the shared memory has already gone, sd-solo -stop has nowhere left to read the daemon's process id from and cannot report on it. Check by hand:

Get-Process sdwind

A script may capture what sd-solo -start prints. $x = sd-solo -start or sd-solo -start | Tee-Object start.log returns as soon as SD has started. The background process it leaves running does not keep the script's pipe: it writes to /dev/null instead, so anything it prints after the start is not seen there. Sent to a file or a console window, its output goes there as before.

One arrangement still waits. sd-solo -start run through cmd /c ... > file from a PowerShell script whose own output is captured (*> file) returned, but the script went on waiting until SD was stopped: the background process kept a Windows handle to the script's output, which it cannot see to give back. Run sd-solo -start directly as above, or use sd-solo -restart, which returns at once.

After an unclean shutdown#

If SD is stopped abruptly — the power goes, or the process is killed — it leaves a shared memory segment behind. On Windows that survives a reboot. Nothing from before a restart can still be using that segment, so SD discards it at the next start and starts normally, printing:

Discarding the shared segment left by the previous boot -
SD did not shut down cleanly.

This changes nothing while the machine is running. A segment belonging to a live SD is still never touched, and sd-solo -start still refuses to disturb a system that is already up.

SD will not start a second time inside itself#

Starting sd-solo from inside sh is refused. The shell that sh and os.execute start is marked as SD's own (the environment variable SD_SESSION is set in it), and sd-solo typed there answers "SD is already running in this session - type exit to return to it." in every form of the command. It keeps a second session from being nested inside the first; it is not a wall, because the mark is an environment variable of that shell. A script that sh runs and that starts SD is refused the same way, wherever it is called from.

Worth knowing alongside it: sh itself needs its switch, which is off as delivered, so you cannot leave SD this way until the administrator turns it on with set.os.access sh on. See Operating system access.

The command line#

sd-solo                  enter the account, after the account password
sd-solo <command>        run one command and return, using the kept password
sd-solo -a               the same as sd-solo: there is one account
sd-solo -asduser         enter that account (any other name is refused)
sd-solo -quiet           suppress the displays on entry
sd-solo -u               list current sessions
sd-solo -k <n> | -k all  end session n, or every session
sd-solo -start           start SD
sd-solo -stop            stop SD
sd-solo --version        report the version
sd-solo --help           a summary of these

sd-solo <command> runs and exits, with no prompt. It uses a copy of the account password Windows keeps for you (see The account and its passwords), which is what lets a script or a scheduled job use SD. If that copy is missing or no longer matches, what happens depends on where the input comes from:

typed at a terminal refused: A command given on the sd command line needs the account password on its input
piped in the first line of the input is taken as the password, once — so a job can supply it itself

set.password keeps the copy up to date when you change the password.

sd-solo -a and sd-solo -a<name> have nothing to choose between: there is one account, sduser, and every session lands in it. sd-solo -asdsys is refused, saying that the SDSYS account is not entered in SD Core Solo for Windows.

sd-solo -u, sd-solo -k and sd-solo -cleanup need no admin. They are switches on the program, outside any SD session, and like -start and -stop they are the business of the user who owns SD, who is the only user: Solo has no sdsys user and no second user whose sessions they could show or remove. -cleanup clears the entries of sessions whose process has gone from the user table. Inside a session, the same jobs are LISTU and LOGOUT, which do need admin — see Sessions and locks.

Where things are#

Everything is under %USERPROFILE%\SDCoreSolo:

Programs usr\bin\ — sd-solo.exe, sdwind.exe (the daemon), sdtic.exe, sdconv.exe, sdfix.exe, sdidx.exe, sdclilib.dll
The changelog changelog
Configuration sd.conf
SD's own files sdsys\
Your account user_accounts\sduser\
Audit trail sdsys\audit
Error log sdsys\errlog
What the installer did install-summary.log

Do not move the programs out of usr\bin. The runtime DLLs ship beside sd-solo.exe deliberately — Windows searches the program's own folder before PATH, which keeps Git for Windows's rival msys-2.0.dll from being picked up. That failure makes SD report "SD has not been started" while it is running, which is worth recognizing because it looks like nothing else. The whole SDCoreSolo folder can be moved; its parts cannot be separated.

The Start Menu has an entry, SD Core Solo, in your own Start Menu (the uninstaller removes it). sd-solo is also on your PATH: open a window and type it.

SD Core Solo always runs in a window of its own, as a Windows application does. The Start Menu entry opens it; typing sd-solo at a PowerShell or cmd prompt opens it too, and the prompt comes back at once, as it does after notepad. The window is a classic console window that SD controls: it starts at 140 columns by 43 lines (make it bigger whenever you like) and is titled SD Core Solo. It is designed for Windows 11 on a screen of at least 1920 by 1080.

When it ends normally (OFF) its window closes. When it ends with an error, for example a refused sign-in, the window stays open with "SD stopped - the reason is shown above. Press Enter to close this window. (exit status n)", so the reason can be read.

These still run where you type them, because they open no session: sd-solo with a command, the switches such as sd-solo -start and sd-solo -stop, anything whose input or output is redirected, and an ssh session.

The full-screen pages need a window of at least 140 columns by 43 lines, which is the size SD's own window starts at. For full screen, press Alt+Enter (in SD's window F11 goes to SD).