patchutil-vserver - Patches: patch #4899, Delete method for vserver command

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4899: Delete method for vserver command

Submitter:  Thomas Champagne <lafeuil>
Submitted:  Thu 09 Feb 2006 12:57:31 PM UTC
   
 
Category:  Core-Utilities Priority:  5 - Normal
Status:  Ready For Test Privacy:  Public
Assigned to:  daniel_hozac Open/Closed:  Closed
Release:  stable

Sun 17 Sep 2006 10:16:45 PM UTC, comment #2: 

Thanks, this has been applied to SVN.

Daniel Hokka Zakrisson <daniel_hozac>
Group Member
Tue 11 Apr 2006 05:37:11 PM UTC, comment #1: 

Here's an applyable patch, that also removes the PKGCFGDIR.

Daniel Hokka Zakrisson <daniel_hozac>
Group Member
Thu 09 Feb 2006 12:57:31 PM UTC, original submission:  

I added a delete method to the vserver command. To test it, patch the script vserver with this diff.

@@ -43,6 +43,7 @@
     restart     ... restarts the specified vserver; this is the subsequent
                     execution of a synchronized \'stop\' and a \'start\'
     condrestart ... restarts the vserver when it is running already
+    delete      ... deletes the vserver
     suexec <user> <shell-command> <args*>
                 ... executes a command as the specified user in the vserver
     exec <shell-command> <args*>
@@ -96,6 +97,21 @@
     exit 0
 }

+function delete()
+{
+    if test -z \"$OPTION_SILENT\" ; then
+       read -p \"Are you sure to delete the vserver $vserver (y/N) \" deleteok
+       if [[ ${deleteok} != [Yy] ]] ; then
+           exit 2
+       fi
+    fi
+
+    isVserverRunning \"$VSERVER_DIR\" &&
+    \"${SELF[@]}\" $OPTION_SILENT --sync \"$vserver\" stop
+
+    rm -rf `readlink -f \"$VSERVER_DIR\"/vdir` \"$VSERVER_DIR\"
+}
+
 function suexec()
 {
     . $__PKGLIBDIR/vserver.suexec
@@ -203,7 +219,7 @@
        shift 2
        . $__PKGLIBDIR/vserver.$cmd
        ;;
-    (suexec|restart)
+    (suexec|restart|delete)
        shift 2
        $cmd \"$@\"
        ;;

Thomas Champagne <lafeuil>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #9767:  util-vserver-0.30.210-delete.patch added by daniel_hozac (4KiB - text/x-patch - The patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-09-17 daniel_hozac StatusNone Ready For Test
    Assigned toNone daniel_hozac
    Open/ClosedOpen Closed
2006-04-11 daniel_hozac Carbon-Copy- Added daniel_hozac
2006-04-11 daniel_hozac Attached File- Added util-vserver-0.30.210-delete.patch, #9767

Back to the top

Powered by Savane 3.14-d582.
Corresponding source code