targetctl(8)

πŸ“¦
version 2.2.4 Β· 2 versions
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

✨ targetctl β€” the manual page bestie πŸ’–

ok so real talk: this is the targetctl page from the System Manager's Manual (it's a section 8 joint, iykyk), and it's lowkey the most unhinged little script in the whole storage stack. let's get into it 🫢


🌸 NAME 🌸

targetctl β€” save and restore the configuration of the kernel target πŸ’Ύβœ¨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so targetctl is a low-level script that saves and restores the configuration of the LIO kernel target, to and from a file in json format. ✨

and like, it is not normally meant to be used by end-users directly, bestie. it's for system init frameworks, or for advanced end-users who are out here generating the configuration file themselves and need a way to load that configuration without relying on the targetcli configuration shell. main character energy for sysadmins only, no cap πŸ’…


πŸŽ€ USAGE πŸŽ€

⚠️ important: targetctl must be invoked as root. no exceptions, she's not asking. πŸ‘‘

exit status will be 0 if successful, or nonzero if an error was encountered. simple as that. πŸ’–

πŸ“ targetctl save [config-file]

saves the current configuration of the kernel target to a file in json format. 🌈

and bestie, listen β€” since the file may contain cleartext passwords, the file's permissions will be set to only allow root access. it's giving protective, it's giving secure. πŸ”’

if config-file is not supplied, targetctl will use the default file location, /etc/target/saveconfig.json. πŸ’Ύ

🧚 targetctl restore [config-file]

removes any existing configuration and replaces it with the configuration described in the file. see saveconfig.json(5) for more details. πŸ“–

if parts of the configuration could not be restored, those parts will be noted in the error output, and the rest of the configuration will still be applied. so like, partial slay. she does her best. 😭

πŸ’œ targetctl clear

removes any existing configuration from the running kernel target. poof. gone. πŸ’€

⭐ targetctl --help

displays usage information. the classic. the icon. πŸ‘‘


🌈 SEE ALSO 🌈


πŸ’… FILES πŸ’…

  • /etc/target/saveconfig.json
  • /sys/kernel/config/target

πŸ‘‘ AUTHOR πŸ‘‘

written by Andy Grover <agrover@redhat.com>. man page written by Andy Grover <agrover@redhat.com>.


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? report it via <targetcli-fb-devel@lists.fedorahosted.org> or <https://github.com/open-iscsi/rtslib-fb/issues> β€” the devs wanna hear from u fr fr 🫢


and that's the whole page bestie!! this was targetctl(8) from the System Manager's Manual β€” so if u see targetctl(8) at the bottom of a real man page, that's just her lil signature, her lil watermark, her name tag at the party πŸŽ€βœ¨ go be root about it responsibly, mwah πŸ’–πŸŒΈ