本文整理匯總了Golang中github.com/giantswarm/yochu/systemd.SystemdClient.Stop方法的典型用法代碼示例。如果您正苦於以下問題:Golang SystemdClient.Stop方法的具體用法?Golang SystemdClient.Stop怎麽用?Golang SystemdClient.Stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/giantswarm/yochu/systemd.SystemdClient
的用法示例。
在下文中一共展示了SystemdClient.Stop方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Teardown
func Teardown(fsc *fs.FsClient, sc *systemd.SystemdClient) error {
vLogger("\n# call iptables.Teardown()")
for _, s := range services {
exists, err := sc.Exists(s)
if err != nil {
return maskAny(err)
}
if !exists {
continue
}
if err := sc.Stop(s); err != nil {
return maskAny(err)
}
}
for _, p := range paths {
if err := fsc.Remove(p); err != nil {
return maskAny(err)
}
}
if err := sc.Reload(); err != nil {
return maskAny(err)
}
return nil
}
示例2: Teardown
func Teardown(fsc *fs.FsClient, sc *systemd.SystemdClient, stopDaemon bool) error {
vLogger("\n# call docker.Teardown()")
for _, s := range services {
exists, err := sc.Exists(s)
if err != nil {
return maskAny(err)
}
if !exists || !stopDaemon {
continue
}
if err := sc.Stop(s); err != nil {
return maskAny(err)
}
}
for _, p := range paths {
if err := fsc.Remove(p); err != nil {
return maskAny(err)
}
}
// reload unit files, that is, `systemctl daemon-reload`
if err := sc.Reload(); err != nil {
return maskAny(err)
}
return nil
}
示例3: Teardown
func Teardown(fsc *fs.FsClient, sc *systemd.SystemdClient, distributionPath, overlayWorkdir, overlayMountPoint string) error {
vLogger("\n# call overlay.Teardown()")
exists, err := sc.Exists(overlayMount)
if err != nil {
return maskAny(err)
}
if exists {
if err := sc.Stop(overlayMount); err != nil {
return maskAny(err)
}
}
if err := fsc.Remove(overlayMountPath); err != nil && !fs.IsNotExist(err) {
return maskAny(err)
}
if err := sc.Reload(); err != nil {
return maskAny(err)
}
if err := fsc.Remove(overlayWorkdir); err != nil && !fs.IsNotExist(err) {
return maskAny(err)
}
return nil
}
示例4: Teardown
func Teardown(fsc *fs.FsClient, sc *systemd.SystemdClient, distributionPath string, stopDaemon bool) error {
vLogger("\n# call rkt.Teardown()")
for _, u := range units {
exists, err := sc.Exists(u)
if err != nil {
return maskAny(err)
}
if !exists || !stopDaemon {
continue
}
if err := sc.Stop(u); err != nil {
return maskAny(err)
}
if err := fsc.Remove(rktSystemdPath + u); err != nil {
return maskAny(err)
}
}
// reload unit files, that is, `systemctl daemon-reload`
if err := sc.Reload(); err != nil {
return maskAny(err)
}
if err := fsc.Remove(distributionPath + "/rkt"); err != nil {
return maskAny(err)
}
return nil
}
示例5: Teardown
func Teardown(fsc *fs.FsClient, sc *systemd.SystemdClient, distributionPath string, stopDaemon bool) error {
vLogger("\n# call fleet.Teardown()")
exists, err := sc.Exists(fleetServiceName)
if err != nil {
return maskAny(err)
}
if exists && stopDaemon {
if err := sc.Stop(fleetServiceName); err != nil {
return maskAny(err)
}
}
if err := fsc.Remove(distributionPath + "/fleet"); err != nil {
return maskAny(err)
}
if err := fsc.Remove(distributionPath + "/fleetd"); err != nil {
return maskAny(err)
}
if err := fsc.Remove(distributionPath + "/fleetctl"); err != nil {
return maskAny(err)
}
if err := sc.Reload(); err != nil {
return maskAny(err)
}
return nil
}