summaryrefslogtreecommitdiff
path: root/clients/zshutdown_notify
diff options
context:
space:
mode:
authorGravatar Richard Basch <probe@mit.edu>1994-04-30 14:25:45 +0000
committerGravatar Richard Basch <probe@mit.edu>1994-04-30 14:25:45 +0000
commit3df88222078253090348adb71f683b92b073b707 (patch)
tree2d8e2513139d60d53ccfc16f28aafe094753712f /clients/zshutdown_notify
parent24f650504a4dae5f1d82e27f36cb809936b60a87 (diff)
Added a more verbose warning that tells the user how to detach lockers
that are on a given host. [lwvanels '91]
Diffstat (limited to 'clients/zshutdown_notify')
-rw-r--r--clients/zshutdown_notify/zshutdown_notify.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/clients/zshutdown_notify/zshutdown_notify.c b/clients/zshutdown_notify/zshutdown_notify.c
index 662f6ae..99a3fce 100644
--- a/clients/zshutdown_notify/zshutdown_notify.c
+++ b/clients/zshutdown_notify/zshutdown_notify.c
@@ -40,7 +40,7 @@ static char *rcsid_zshutdown_notify_c =
* the message body.
*/
-static char warning[] = "Please detach any filesystems you may have\nattached from this host!";
+static char warning[] = "Please detach any filesystems you may have\nattached from this host by typing detach -host %s";
/*ARGSUSED*/
main(argc,argv)
@@ -52,6 +52,7 @@ main(argc,argv)
int retval;
char hostname[MAXHOSTNAMELEN];
char msgbuff[BUFSIZ], message[Z_MAXPKTLEN], *ptr;
+ char scratch[BUFSIZ];
char *msg[N_FIELD_CNT];
#ifdef Z_HaveKerberos
char tkt_filename[MAXPATHLEN];
@@ -61,10 +62,6 @@ main(argc,argv)
extern char *krb_get_phost();
#endif
- msg[0] = hostname;
- msg[1] = message;
- msg[2] = warning;
-
if (gethostname(hostname, MAXHOSTNAMELEN) < 0) {
com_err(argv[0], errno, "while finding hostname");
exit(1);
@@ -73,6 +70,11 @@ main(argc,argv)
if ((hp = gethostbyname(hostname)) != NULL)
(void) strcpy(hostname, hp->h_name);
+ msg[0] = hostname;
+ msg[1] = message;
+ sprintf(scratch, warning, hostname);
+ msg[2] = scratch;
+
#ifdef Z_HaveKerberos
(void) sprintf(tkt_filename, "/tmp/tkt_zshut_%d", getpid());
krb_set_tkt_string(tkt_filename);