Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: Bob on December 13, 2003, 03:44:00 AM

Title: SME 6 & loginscript rpm
Post by: Bob on December 13, 2003, 03:44:00 AM
Is it just me or does this not work with SME 6.
It installs and displays fine but when I save the script thats where I get the error.
I'm using e-smith-loginscript-0.2-2.noarch.rpm

Any help appreciated.

Thanks,

Bob.
Title: Re: SME 6 & loginscript rpm
Post by: Robbie on December 21, 2003, 10:44:37 PM
Bob,

The exact same thing is happening to me with SME 6.0 and e-smith-loginscript-0.2.2.noarch.rpm. Did you every find a solution?

Robbie
Title: Re: SME 6 & loginscript rpm
Post by: Bob on December 22, 2003, 12:31:27 AM
No nothing yet.
The only ting that I have come up with is to modify the netlogon.bat in each users profile which I haven't done yet.
I'm still using my old server 5.6 until I get this bit sorted.
Please let me know if you come across a fix
Regards,

Bob.
Title: Re: SME 6 & loginscript rpm
Post by: Graham on December 24, 2003, 10:46:25 PM
Theres lots of posts on this one if you serach the fourms.

At one point I had used a contrib that let me specify 'if in group'

I cant remeber where I got it but it wouldnt work above e-s4.1.2
(or at least I couldnt get it to work)

Someone pointed me to these utils :-

ingrp32.exe works for NT/2000.
ifmember.exe works for 9x.

I havent had reason to use them since though and have just
used the netlogon.bat/net use for things like time setting and
mapping drives.

The only thing I struggled with occasionally was home drives
and win xp home version (ended up mapping netowkr drive in
win)
Title: Re: SME 6 & loginscript rpm
Post by: asotelo on January 04, 2004, 05:29:53 PM
I've been trying to use  e-smith-loginscript-0.2-3.noarch.rpm in SME 6.0 but it doesn't work. It installs fine but when saving the script it fails. I installed on SME5.6u6 and it works fine. I'm trying to map drives based on group membership but neither ifmember.exe, ingroup32 or Kixtart displays domain local groups just domain global groups. The client is a Windows 2000 Pro. It seems to me that best solution is to modify
e-smith-loginscript-0.2-3.noarch.rpm to work in SME 6.0. Any ideas on how to do that?
Title: Re: SME 6 & loginscript rpm
Post by: Ray Mitchell on January 05, 2004, 02:32:35 AM
In v6 the netlogon.bat file is in /home/e-smith/files/samaba/netlogon
whereas in v5.6 it was in /home/netlogon.
Perhaps that is the reason for the problem, maybe the rpm needs updating or perhaps the file could be manually saved to the new location ??
Just guessing here, anybody else know more specifically how the rpm works ?

Regs
Ray
Title: Re: SME 6 & loginscript rpm
Post by: JeffC on January 05, 2004, 03:04:40 PM
Ray Mitchell wrote:

> In v6 the netlogon.bat file is in
> /home/e-smith/files/samaba/netlogon
> whereas in v5.6 it was in /home/netlogon.
> Perhaps that is the reason for the problem, maybe the rpm
> needs updating or perhaps the file could be manually saved to
> the new location ??


Edit the file workgrouplogonscript that is in the /etc/e-smith/web/functions directory.  

Change the path of the netlogon.bat file to the one that Ray mentioned and you should be good to go.

-jeff
Title: Re: SME 6 & loginscript rpm
Post by: asotelo on January 06, 2004, 02:37:08 AM
Jeff,

I tried your suggestion without success. I edited the file /etc/e-mith/web/functions/loginscript to reflect the netlogon path. I'm still getting same error.

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, admin and inform them of the time
the error occurred, and anything you might have done that may have caused
the error.
More information about this error may be available in the server error log."

This is the information from the httpd/admin error log:
----------------------------------------------------------------------------
loginscript: esmith::showInitial() called too early to check prototype at /etc/e-smith/web/panels/manager/cgi-bin/loginscript line 62.
[Mon Jan  5 01:47:22 2004] loginscript: esmith::performAndShowResult() called too early to check prototype at /etc/e-smith/web/panels/manager/cgi-bin/loginscript line 67.
[Mon Jan  5 01:47:25 2004] [error] [client 127.0.0.1] File does not exist: /etc/e-smith/web/common/e-smith-manager.gif
[Mon Jan  5 01:47:25 2004] [error] [client 127.0.0.1] File does not exist: /etc/e-smith/web/common/banner.gif
[Mon Jan  5 01:48:09 2004] loginscript: esmith::showInitial() called too early to check prototype at /etc/e-smith/web/panels/manager/cgi-bin/loginscript line 62.
[Mon Jan  5 01:48:09 2004] loginscript: esmith::performAndShowResult() called too early to check prototype at /etc/e-smith/web/panels/manager/cgi-bin/loginscript line 67.
[Mon Jan  5 01:48:15 2004] loginscript: Error occurred while saving logon drive.
[Mon Jan  5 01:48:15 2004] [error] [client 127.0.0.1] malformed header from script. Bad header=
Error occurred while savi: /etc/e-smith/web/panels/manager/cgi-bin/loginscript
			
Title: Re: SME 6 & loginscript rpm
Post by: Craig on January 07, 2004, 05:02:02 PM
Hi,

I have also been having problems with this contrib on SME 6.0.

I have looked through all the templates and config scripts that I could find and changed the paths but still get the error below in my log file.

Any ideas?

Regards
Craig

Jan  7 23:59:01 ws1 e-smith[13567]: Processing event: conf-logondrive
Jan  7 23:59:01 ws1 e-smith[13567]: Running event handler: /etc/e-smith/events/conf-logondrive/S25conf-samba
Jan  7 23:59:01 ws1 e-smith[13567]: S25conf-samba=action|Event|conf-logondrive|Action|S25conf-samba|Start|1073491141 63754|End|1073491141 399467|Elapsed|0.33
5713
Jan  7 23:59:01 ws1 e-smith[13567]: Running event handler: /etc/e-smith/events/conf-logondrive/S50reload-samba
Jan  7 23:59:01 ws1 e-smith[13567]: S50reload-samba=action|Event|conf-logondrive|Action|S50reload-samba|Start|1073491141 399602|End|1073491141 570612|Elapsed
|0.17101
Jan  7 23:59:01 ws1 e-smith[13567]: Running event handler: /etc/e-smith/events/conf-logondrive/S75conf-loginscript
Jan  7 23:59:01 ws1 e-smith[13567]: ERROR: No templates were found for /home/e-smith/files/samba/netlogon/netlogon.bat.
Jan  7 23:59:01 ws1 e-smith[13567]:  at /etc/e-smith/events/conf-logondrive/S75conf-loginscript line 33
Jan  7 23:59:01 ws1 e-smith[13567]: S75conf-loginscript=action|Event|conf-logondrive|Action|S75conf-loginscript|Start|1073491141 570758|End|1073491141 688530
|Elapsed|0.117772|Status|65280
Title: SME 6 & loginscript rpm
Post by: ansentry on March 20, 2004, 12:45:04 PM
I have been using e-smith-loginscript-0.2-2.noarch.rpm with 5.6 (Workstations running Win98, W2K and WinXP) worked fine. An example was

net time \\yourservername/set /yes
net use P: \\yourservername\public_sh

#ifg securefiles
net use M: \\yourservername\smefiles
#endif

#ifg access_users
net use Y: \\yourservername\access_be
#endif

#ifg admin_group
net use K: \\yourservername\admin_sh
#endif

As you can see I was using g (group) in the batch file. This all worked fine, but when on a new server I installed SME6 (Workstations all running W2K) the rpm would not work and neither would the g (group).

So this is what I did (if you have already discovered this then I am sorry for boring you)

cd /home/e-smith/files/samaba/netlogon

Then I used "mc" to edit the netlogon.bat file that is already there. I changed the above example to the below example. What I found that samba appears to read the users permissions to connect to drives .It also appears that when you have made changes to user/groups or groups/users it is best to  reboot the server. Even in 5.6 I have had to enable the tick and then save and then tick again before it was accepted.


net time \\yourservername /set /yes
net use P: \\yourservername\public_sh
net use M: \\yourservername\smefiles
net use Y: \\yourservername\access_be
net use K: \\yourservername\admin_sh


I have one problem connecting W2K to SME6, the login script connect H:\ to the Home directory BUT windows also connects Z:\ to the Home directory. I have opened up the system.adm file but am unsure if I am on the right track.

Any one with informartion would be appreciated.

Hope this help someone, I search the forum and could not find an answer, before I posted this. ;-)
Title: loginscript in SME 6.0
Post by: jmvelez on August 19, 2004, 01:04:45 AM
The contribution for loginscript does not work with 6.0 but it can be fix with the ln command.  Version 6 stores the netlogon in a /home/e-smith/files/samba/netlogon and ver. 5.6 stores it /home/netlogon.   The fix for 6.0 is the following

ln -s /home/e-smith/files/samba/netlogon /home/netlogon

You can download the RPM or do a search for it.

http://www.ibiblio.org/pub/linux/distributions/e-smith/contrib/DanielvanRaay/RPMS/noarch/e-smith-loginscript-0.2-2.noarch.rpm
Title: possible issue
Post by: gocdo on August 19, 2004, 05:24:59 AM
Hi,

I was also having problems with this contrib - on 5.6 was fine but 6.0.1 failed (same location and setup).

A collegue of mine found that if the server was in gateway mode it was fine, in server mode it failed. We now run it in gateway mode and haven't had further problems.

Regards
kevin
Title: SME 6 & loginscript rpm
Post by: alltg on September 14, 2004, 04:28:53 AM
I seem to have got them working on sme 6.01-1 with windowx XP

This machine is my testing machine and it has been heavily patched and played with.  My next step is to test it with a fresh clean machine.  If that works, I  will put it on a production machine.

Three scripts make it work.  I can't remember, but I think logonscript.pl has to have chmod +x

As a bonus, there is code here (clause containing user abby) for individual users - not dependent upon group membership.

/etc/e-smith/templates-custom/samba/11logonScript
/etc/e-smith/templates-custom/samba/61netlogonshare
/home/netlogon/bin/logonscript.pl





/etc/e-smith/templates-custom/samba/11logonScript
Code: [Select]
  ; login script from templates-custom
   logonscript = %U.bat


/etc/e-smith/templates-custom/samba/61netlogonshare
Code: [Select]
{
    return "" unless db_get_prop($confref, "smb", "DomainMaster") eq "yes";

    $OUT .= <<HERE;
[netlogon]
comment = Network Logon Service
path = /home/netlogon
root preexec = /home/netlogon/bin/logonscript.pl %U
root postexec = rm /home/netlogon/%U.bat
guest ok = yes
writable = yes
browseable = no
HERE
}



/home/netlogon/bin/logonscript.pl
Code: [Select]
#!/usr/bin/perl
sub ingroup($)
{
  my $group=shift;
  my $result=0;
  my $lcuser=lc($ARGV[0]);

  open (FD,"</etc/group");
  while (<FD>)
  {
    my $data=$_;
    if ($data =~ /$group/)
    {
      if ($data =~ /$lcuser/)
      {
        $result=1;
        last;
      }
    }
  }
  close FD;
  return $result;
}

open LOGON, ">/home/netlogon/$ARGV[0].bat";

# print LOGON "\@echo off\r\n";
# print LOGON "cls\r\n";
# if ($ARGV[0] == "abby" ) {
#       print LOGON "\r\n---\r\nUSERNAME  IS Abby\r\n---\r\n\r\n";
# }

print LOGON "echo Welcome $ARGV[0] to the My Company SME Network - Cheaper than MS Windows Servers and much more stable\r\n";
print LOGON "echo.\r\n";
print LOGON "echo set user=$ARGV[0]\r\n";
print LOGON "rem $ARGV[0] logged into $ARGV[1]\r\n";
print LOGON "rem \@echo off \r\n";
print LOGON "NET USE H: \\\\fs1\\$ARGV[0]\r\n";

print LOGON "NET USE K: \\\\fs1\\i_documents\r\n";
print LOGON "NET USE X: \\\\fs1\\i_apps\r\n";

# -----------------------------------
# Map Jobs program users to the I_jobs share
# -----------------------------------
        if (&ingroup("g_job")) { print LOGON "NET USE j: \\\\fs1\\i_jobs\r\n"};
# -----------------------------------
# Map Cad users to the I_policies share
# -----------------------------------
        if (&ingroup("g_policies")) { print LOGON "NET USE p: \\\\fs1\\i_policiess\r\n"};

print LOGON "NET TIME \\\\fs1 /SET /YES\r\n";

 if ($ARGV[0] eq "jon")
  {
        print LOGON "NET USE z: \\\\fs1\\backup\$\r\n";
  };

# print LOGON "pause";
close LOGON;



Title: Re: loginscript in SME 6.0
Post by: asotelo on September 23, 2004, 05:58:06 AM
Quote from: "jmvelez"
The contribution for loginscript does not work with 6.0 but it can be fix with the ln command.  Version 6 stores the netlogon in a /home/e-smith/files/samba/netlogon and ver. 5.6 stores it /home/netlogon.   The fix for 6.0 is the following

ln -s /home/e-smith/files/samba/netlogon /home/netlogon

You can download the RPM or do a search for it.

http://www.ibiblio.org/pub/linux/distributions/e-smith/contrib/DanielvanRaay/RPMS/noarch/e-smith-loginscript-0.2-2.noarch.rpm


This also works for  version SME 6.0.1 It fixed my problems.

Thanks jmvelez!!
 :-D  :-D
Title: SME 6 & loginscript rpm
Post by: mrjhb3 on September 27, 2004, 12:33:17 AM
I have this working as well.  I do have one question.
Where are the #ifx tags defined at?

The sample login script states that for #ifa:
REM The available Architectures are:
REM   WinNT = Windows NT or 2000
REM   Win95 = Windows 95 or 98
REM   WfWg = Windows for Workgroups

I was wondering if winxp needs or can be defined.  I have not done enough testing with xp to know for sure yet.

Thanks,

JB