Documentation ¶
Index ¶
- func WithIdleTimeout(timeout time.Duration) func(o *options) error
- func WithLibZFS(libzfs libzfs.Interface) func(o *options) error
- type Server
- func (s *Server) ChangeHomeOnUserData(req *zsys.ChangeHomeOnUserDataRequest, ...) (err error)
- func (s *Server) CommitBoot(req *zsys.Empty, stream zsys.Zsys_CommitBootServer) (err error)
- func (s *Server) CreateUserData(req *zsys.CreateUserDataRequest, stream zsys.Zsys_CreateUserDataServer) (err error)
- func (s *Server) DaemonStop(req *zsys.Empty, stream zsys.Zsys_DaemonStopServer) error
- func (s *Server) DumpStates(req *zsys.Empty, stream zsys.Zsys_DumpStatesServer) error
- func (s *Server) GC(req *zsys.GCRequest, stream zsys.Zsys_GCServer) error
- func (s *Server) Listen() error
- func (s *Server) LoggingLevel(req *zsys.LoggingLevelRequest, stream zsys.Zsys_LoggingLevelServer) error
- func (s *Server) MachineList(req *zsys.Empty, stream zsys.Zsys_MachineListServer) error
- func (s *Server) MachineShow(req *zsys.MachineShowRequest, stream zsys.Zsys_MachineShowServer) error
- func (s *Server) PrepareBoot(req *zsys.Empty, stream zsys.Zsys_PrepareBootServer) (err error)
- func (s *Server) Refresh(req *zsys.Empty, stream zsys.Zsys_RefreshServer) error
- func (s *Server) Reload(req *zsys.Empty, stream zsys.Zsys_ReloadServer) error
- func (s *Server) RemoveSystemState(req *zsys.RemoveSystemStateRequest, stream zsys.Zsys_RemoveSystemStateServer) (err error)
- func (s *Server) RemoveUserState(req *zsys.RemoveUserStateRequest, stream zsys.Zsys_RemoveUserStateServer) error
- func (s *Server) SaveSystemState(req *zsys.SaveSystemStateRequest, stream zsys.Zsys_SaveSystemStateServer) (err error)
- func (s *Server) SaveUserState(req *zsys.SaveUserStateRequest, stream zsys.Zsys_SaveUserStateServer) (err error)
- func (s *Server) Status(req *zsys.Empty, stream zsys.Zsys_StatusServer) error
- func (s *Server) Stop()
- func (s *Server) Trace(req *zsys.TraceRequest, stream zsys.Zsys_TraceServer) error
- func (s *Server) TrackRequest() func()
- func (s *Server) Version(req *zsys.Empty, stream zsys.Zsys_VersionServer) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithIdleTimeout ¶ added in v0.4.0
WithIdleTimeout changes server default idle timeout
func WithLibZFS ¶ added in v0.4.0
WithLibZFS allows overriding default libzfs implementations with a mock
Types ¶
type Server ¶
type Server struct { // Machines scanned Machines machines.Machines // Requests mutex RWRequest sync.RWMutex // contains filtered or unexported fields }
Server is used to implement zsys.ZsysServer.
func New ¶
New returns an new, initialized daemon server, which handles systemd activation socket is ignored if we are using socket activation.
func (*Server) ChangeHomeOnUserData ¶
func (s *Server) ChangeHomeOnUserData(req *zsys.ChangeHomeOnUserDataRequest, stream zsys.Zsys_ChangeHomeOnUserDataServer) (err error)
ChangeHomeOnUserData tries to find an existing dataset matching home as a valid mountpoint and rename it to newhome
func (*Server) CommitBoot ¶
CommitBoot commits current state to be the active one by promoting its datasets if needed, set last used, associate user datasets to it and rebuilding grub menu. After this operation, every New() call will get the current and correct system state. Return if any dataset / machine changed has been done during boot commit and an error if any encountered.
func (*Server) CreateUserData ¶
func (s *Server) CreateUserData(req *zsys.CreateUserDataRequest, stream zsys.Zsys_CreateUserDataServer) (err error)
CreateUserData creates a new userdata for user and set it to homepath on current zsys system. if the user already exists for a dataset attached to the current system, set its mountpoint to homepath. This is called by zsys grpc request, once the server is registered
func (*Server) DaemonStop ¶ added in v0.4.0
DaemonStop stops zsys daemon
func (*Server) DumpStates ¶ added in v0.4.0
DumpStates dumps the entire internal state of zsys daemon
func (*Server) Listen ¶
Listen serves on its unix socket path. It handles systemd activation notification. When the server stop listening, the socket is removed automatically.
func (*Server) LoggingLevel ¶ added in v0.4.0
func (s *Server) LoggingLevel(req *zsys.LoggingLevelRequest, stream zsys.Zsys_LoggingLevelServer) error
LoggingLevel set the verbosity of the logger
func (*Server) MachineList ¶ added in v0.4.0
MachineList returns a list of machines and their summary
func (*Server) MachineShow ¶ added in v0.4.0
func (s *Server) MachineShow(req *zsys.MachineShowRequest, stream zsys.Zsys_MachineShowServer) error
MachineShow returns information about the machine id passed in argument
func (*Server) PrepareBoot ¶
PrepareBoot consolidates canmount states for early boot. Return if any dataset / machine changed has been done during boot and an error if any encountered.
func (*Server) RemoveSystemState ¶ added in v0.4.0
func (s *Server) RemoveSystemState(req *zsys.RemoveSystemStateRequest, stream zsys.Zsys_RemoveSystemStateServer) (err error)
RemoveSystemState removes this and all depending states from system.
func (*Server) RemoveUserState ¶ added in v0.4.0
func (s *Server) RemoveUserState(req *zsys.RemoveUserStateRequest, stream zsys.Zsys_RemoveUserStateServer) error
RemoveUserState removes a user state
func (*Server) SaveSystemState ¶ added in v0.4.0
func (s *Server) SaveSystemState(req *zsys.SaveSystemStateRequest, stream zsys.Zsys_SaveSystemStateServer) (err error)
SaveSystemState creates a snapshot of a system and all users datasets. If stateName is not empty, it is used as the id of the snapshot otherwise an id is generated with a random string.
func (*Server) SaveUserState ¶ added in v0.4.0
func (s *Server) SaveUserState(req *zsys.SaveUserStateRequest, stream zsys.Zsys_SaveUserStateServer) (err error)
SaveUserState creates a snapshot for the provided user. If snapshotName is not empty, it is used as the id of the snapshot otherwise an id is generated with a random string. userName is the name of the user to snapshot the datasets from.
func (*Server) Trace ¶ added in v0.4.0
func (s *Server) Trace(req *zsys.TraceRequest, stream zsys.Zsys_TraceServer) error
Trace performs CPU of MEM profiling and returns the trace to the client
func (*Server) TrackRequest ¶
func (s *Server) TrackRequest() func()
TrackRequest prevents the idling timeout to fire up and return the function to reset it.