Attempting to Create Unraid Users Programmatically (CLI) I'm trying to automate user creation on Unraid without using the web GUI. Here's what I've tested and observed so far. Environment - Unraid 7.2.2, Slackware 15.0+, x86_64 What Works: System-Level User Creation Standard Linux commands create a user that works for system access and SMB: # Create system user useradd -u 1050 -g 100 -d / -s /bin/false newuser # Persist to boot config (survives reboot) grep "^newuser:" /etc/passwd >> /boot/config/passwd # Add shadow entry echo "newuser:x:$(( $(date +%s) / 86400 ))::::::" >> /boot/config/shadow # (Optional) Set SMB password echo -e "password\npassword" | smbpasswd -a newuser After running this, id newuser works, usermod -aG works, SMB authentication works. The user is fully functional at the system level. However, the user does not appear in the Unraid web GUI until the next reboot. After a reboot, the user does appear in the GUI. So whatever populates the GUI user list reads /boot/config/passwd at boot time. What the GUI Does When Creating a User (Observed via syslog) I monitored /var/log/syslog while creating a user called testgui through the web GUI. These entries appeared: emhttpd: shcmd (137): useradd -g users -d / -s /bin/false -c '' 'testgui' useradd: new user: name=testgui, UID=2003, GID=100, home=/, shell=/bin/false chpasswd: password changed for testgui emhttpd: Restarting services... emhttpd: shcmd (145): /etc/rc.d/rc.samba reload emhttpd: shcmd (148): exportfs -ra emhttpd: shcmd (150): /etc/rc.d/rc.avahidaemon reload emhttpd: shcmd (155): cp /etc/passwd /etc/shadow /var/lib/samba/private/smbpasswd /boot/config Observations: - emhttpd calls useradd without specifying a UID (auto-assigned) - It uses chpasswd to set the password - It reloads samba, NFS exports, and avahi - It copies /etc/passwd, /etc/shadow, and smbpasswd FROM /etc/ TO /boot/config/ File Monitoring (inotifywait) I ran inotifywait on /boot/config/passwd, /boot/config/shadow, /boot/config/smbpasswd, and /var/local/emhttp/users.ini while creating a user through the GUI. The write events observed were: /boot/config/passwd MODIFY /boot/config/shadow MODIFY /boot/config/smbpasswd MODIFY /var/local/emhttp/users.ini DELETE_SELF The users.ini file received a DELETE_SELF event — it appears to be deleted and recreated rather than appended to. What I Tried That Doesn't Work 1. emcmd (Unraid's CLI tool) /usr/local/sbin/emcmd "cmdUserEdit=Add&userName=newuser&userPassword=$(echo -n 'pass' | base64)&userPasswordConf=$(echo -n 'pass' | base64)" emcmd is a PHP script at /usr/local/emhttp/plugins/dynamix/scripts/emcmd that uses curl_socket to post to /var/run/emhttpd.socket at the path http://localhost/update. The call blocks indefinitely. No useradd entry appears in syslog even after waiting 30+ seconds. I tried: - Backgrounding with nohup and & - Running via at job scheduler (fully detached) - Killing the process after various timeouts (5s, 10s, 15s, 30s) - Using /update.htm as the path instead of /update - Writing a custom PHP script using curl_socket directly None of these produced a user. No emhttpd: shcmd: useradd entry ever appeared in syslog from any CLI-initiated attempt. Interestingly, emcmd DOES work for deleting users that were created through the GUI: /usr/local/sbin/emcmd "cmdUserEdit=Delete&userName=testgui" This also blocks, but the user IS deleted (confirmed via id and syslog showing userdel). 2. Direct socket writes Tried posting directly to the emhttpd socket using PHP stream_socket_client, curl with CURLOPT_UNIX_SOCKET_PATH, and bash. Responses were either HTTP 500, 0 bytes received (timeout), or the connection hung. 3. curl via nginx with session cookie curl -sk -c cookies.txt -X POST https://nas.local/login -d 'username=root&password=xxx' -L curl -sk -b cookies.txt -X POST https://nas.local/update.htm -d 'cmdUserEdit=Add&...' Returns 502 Bad Gateway — nginx times out waiting for a response. 4. Appending to users.ini I appended a properly formatted entry to /var/local/emhttp/users.ini. The entry was present in the file (confirmed with grep), but the user did not appear in the GUI. Refreshing the page, clearing cache, etc. had no effect. The user only appeared after a reboot. 5. GraphQL API The GraphQL endpoint at /graphql is active on Unraid 7.2.2, but user management mutations don't exist. Tested addUser, createUser, setUser, updateUser — all return "Cannot query field on type Mutation." Questions 1. Is there a supported way to create users from the command line that the GUI will recognize without a reboot? 2. Is there a command or signal to refresh the GUI's user list from /boot/config/passwd? 3. Why does emcmd cmdUserEdit=Delete work but cmdUserEdit=Add appears not to? 4. Are there plans to add user management to the GraphQL API? Current Workaround Using useradd + config file writes. The user is fully functional for system and SMB access immediately. GUI visibility requires a reboot. Functional but not ideal for automation. Summary Method User Created? In GUI? Deletable from GUI? GUI (Add User) Yes Yes Yes useradd + config files Yes After reboot only Not tested emcmd cmdUserEdit=Add No (hangs) N/A N/A Direct socket write No N/A N/A curl via nginx No (502) N/A N/A Append to users.ini N/A No N/A GraphQL API No (no mutation) N/A N/A