host.rc
author Claus Gittinger <cg@exept.de>
Fri, 08 Aug 1997 15:16:42 +0200
changeset 239 610af02f6b7e
parent 216 784202865f5f
child 254 9de729ce1390
permissions -rw-r--r--
only reset printer settings, if started on another host.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
     1
"*
0cb137a77319 Initial revision
claus
parents:
diff changeset
     2
 * $Header$
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
     3
 *
209
22793de5d56e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
     4
 * ST/X startup configuration file:
22793de5d56e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
     5
 *
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
     6
 * DONT add site specific things here - use your own h_xxx.rc file instead
8
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
     7
 * where xxx stands for your hostname(s)
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
     8
 *
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
     9
 * startup configuration for host specific stuff -
0cb137a77319 Initial revision
claus
parents:
diff changeset
    10
 * looks for a host specific init file and loads it.
0cb137a77319 Initial revision
claus
parents:
diff changeset
    11
 *"
0cb137a77319 Initial revision
claus
parents:
diff changeset
    12
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    13
|sysType host domain s rshCommand isStupidSYSV3|
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    14
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    15
sysType := OperatingSystem getSystemType.
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    16
isStupidSYSV3 := false.
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
    17
216
784202865f5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
    18
"/ on some systems, paging in is so slow, that a SIGALRM
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    19
"/ arrives too early to be handled correctly 
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    20
"/ (I guess, this is my fault somewhere ... ;-)
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    21
"/
216
784202865f5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
    22
"/ This can be worked around by disabling the timer here.
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    23
"/ (The sceduler will reenable it later)
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    24
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    25
(sysType = 'hpux') ifTrue:[
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
    26
    OperatingSystem disableSignal:(OperatingSystem sigALRM)
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
    27
].
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
    28
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    29
sysType = 'realIX' ifTrue:[
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    30
    "/
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    31
    "/ those people must have been brain-damaged;
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    32
    "/ They made a whole lot of trouble by renaming
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    33
    "/ 'rsh' to 'remsh' (those systems are broken in other places as well ...).
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    34
    "/ (who needs a restricted shell named 'rsh' ?)
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    35
    "/
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    36
    isStupidSYSV3 := true.
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    37
].
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    38
239
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    39
"/ only reset the printer setting, if restarted
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    40
"/ on another host.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    41
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    42
host := OperatingSystem getHostName.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    43
(Smalltalk at:#'_ImageHostName') ~= host ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    44
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    45
    "/
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    46
    "/ setup the printer stuff.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    47
    "/ the commands below will be offered in the printer-setting box
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    48
    "/
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    49
    PostscriptPrinterStream notNil ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    50
	isStupidSYSV3 ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    51
	    PostscriptPrinterStream 
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    52
		defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    53
				    'lpr'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    54
				    'cat | remsh <hostname> lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    55
				    'cat > preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    56
				    'cat > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    57
				 ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    58
	] ifFalse:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    59
	    PostscriptPrinterStream 
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    60
		defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    61
				    'lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    62
				    'cat | rsh <hostname> lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    63
				    'cat > preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    64
				    'cat > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    65
				 ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    66
	].
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    67
	PostscriptPrinterStream printCommand:'lpr'.
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    68
    ].
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    69
239
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    70
    PrinterStream notNil ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    71
	isStupidSYSV3 ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    72
	    PrinterStream 
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    73
		defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    74
				    'lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    75
				    'cat | remsh <hostname> lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    76
				    'a2ps | remsh <hostname> lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    77
				    'a2ps > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    78
				 ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    79
	] ifFalse:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    80
	    PrinterStream 
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    81
		defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    82
				    'lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    83
				    'cat | rsh <hostname> lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    84
				    'a2ps | rsh <hostname> lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    85
				    'a2ps > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    86
				 ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    87
	].
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    88
	Printer := PrinterStream.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    89
	PrinterStream printCommand:'lpr'.
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
    90
    ].
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    91
239
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    92
    "/ Printer := PostscriptPrinterStream.
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
    93
239
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    94
    "/ in our home-domain, preset the print command for remote printing
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    95
    "/ on a host called 'ibm'.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    96
    "/ You can change this for your environment and/or make it
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    97
    "/ unconditional.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    98
    "/ Consider the stuff below as an example; you should add
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    99
    "/ corresponding setup into a private h_xxxx.rc file.
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   100
239
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   101
    domain := OperatingSystem getDomainName.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   102
    (domain = 'axept.de' or:[domain = 'exept.de']) ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   103
	isStupidSYSV3 ifTrue:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   104
	    PostscriptPrinterStream printCommand:'cat | remsh ibm lpr -h'.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   105
	    PrinterStream printCommand:'cat | remsh ibm lpr -h'.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   106
	    PostscriptPrinterStream defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   107
					    'cat | remsh ibm lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   108
					    'cat > preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   109
					    'cat > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   110
				     ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   111
	    PrinterStream defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   112
					    'cat | remsh ibm lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   113
					    'a2ps | remsh ibm lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   114
					    'a2ps > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   115
				     ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   116
	] ifFalse:[
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   117
	    PostscriptPrinterStream printCommand:'cat | rsh ibm lpr -h'.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   118
	    PrinterStream printCommand:'cat | rsh ibm lpr -h'.
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   119
	    PostscriptPrinterStream defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   120
					    'cat | rsh ibm lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   121
					    'cat > preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   122
					    'cat > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   123
				     ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   124
	    PrinterStream defaultCommands:#(
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   125
					    'cat | rsh ibm lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   126
					    'a2ps | rsh ibm lpr -h'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   127
					    'a2ps > preview.ps; ghostview preview.ps'
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   128
				     ).
610af02f6b7e only reset printer settings, if started on another host.
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   129
	].
177
eec6bac738ba stupid SYSV3: renamed rsh to remsh
Claus Gittinger <cg@exept.de>
parents: 169
diff changeset
   130
    ].
103
9f5c03497b38 example - checking for the domain
Claus Gittinger <cg@exept.de>
parents: 8
diff changeset
   131
].
9f5c03497b38 example - checking for the domain
Claus Gittinger <cg@exept.de>
parents: 8
diff changeset
   132
165
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   133
"/
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   134
"/ try host-specific setup
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   135
"/ (h_<hostname>.rc
bb77927038c7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   136
"/
2
353a88ada7c6 *** empty log message ***
claus
parents: 0
diff changeset
   137
host isNil ifTrue:[
195
1cf850844da9 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 177
diff changeset
   138
    'host.rc [warning]: cannot determine host I am running on' errorPrintCR.
2
353a88ada7c6 *** empty log message ***
claus
parents: 0
diff changeset
   139
] ifFalse:[
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
   140
    "if there is a corresponding file ..."
103
9f5c03497b38 example - checking for the domain
Claus Gittinger <cg@exept.de>
parents: 8
diff changeset
   141
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
   142
    (Smalltalk at:#'_ImageHostName') ~= host ifTrue:[
195
1cf850844da9 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 177
diff changeset
   143
	('host.rc [info]: trying host setup h_' , host , '.rc ...') infoPrintCR.
5
420e4af41733 *** empty log message ***
claus
parents: 2
diff changeset
   144
8
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   145
	s := Smalltalk systemFileStreamFor:('h_' , host , '.rc').
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   146
	s notNil ifTrue:[
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   147
	    s fileIn.
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   148
	    s close.
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   149
	].
d82829c0d867 *** empty log message ***
claus
parents: 5
diff changeset
   150
	Smalltalk at:#'_ImageHostName' put:host.
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
   151
    ]
0cb137a77319 Initial revision
claus
parents:
diff changeset
   152
].
0cb137a77319 Initial revision
claus
parents:
diff changeset
   153
!