Monday, March 11, 2013

How to configure Samba in Oracle Solaris 10

In the name of Allah, Most Gracious, Most Merciful

Samba comes installed with Oracle Solaris 10. We only have to configure it according to our needs. Following are steps to properly configure samba according to our needs.

You can verify that samba packages are already installed in Oracle Solaris 10 by following command.

1. pkginfo -x | grep -i samba

SUNWsmbac    samba - A Windows SMB/CIFS fileserver for UNIX (client)
SUNWsmbar    samba - A Windows SMB/CIFS fileserver for UNIX (Root)
SUNWsmbau    samba - A Windows SMB/CIFS fileserver for UNIX (Usr)


2. You can check the location of samba config file by following command

pkgchk -l SUNWsmbar | grep conf-example

Pathname: /etc/samba/smb.conf-example

3. Check current state of samba

svcs -a | grep samba

disabled       Feb_22   svc:/network/samba:default

4. Try to enable samba

svcadm enable samba

maintenance    10:27:33 svc:/network/samba:default

It is not enabled, but it is in maintenance mode. You can check the errors encountered while enabling samba by following command.

tail /var/adm/messages

mysystem svc.startd[8]: [ID 652011 daemon.warning] svc:/network/samba:default: Method "/usr/sbin/smbd -D" failed with exit status 1

It means samba failed to start, it most likely due to missing config file.

5. Now copy the sample config file and modify it

cp /etc/samba/smb.conf-example /etc/samba/smb.conf

By default config file is readonly, so make is right able by following command.

chmod 0777 /etc/samba/smb.conf

vi /etc/samba/smb.conf

Add following section in smb.conf file.

[myshare]
comment = My Share
force user = oracle
path = /u01/app/oracle
writeable = no
guest ok = yes


now save file and exit vi.

6. Now change the rights on smb.conf file as before

chmod 0444 /etc/samba/smb.conf

7. Now try to disable samba

svcadm disable samba
svcs -a | grep samba

disabled       10:41:49 svc:/network/samba:default


8. Now try to enable samba again

svcadm enable samba
svcs -a | grep samba

online         10:42:04 svc:/network/samba:default


9. Now set password for oracle user to use "myshare".

smbpasswd -a oracle

10. Now on windows try to map drive

net use O: \\192.168.1.20\myshare

Configuration of samba completes. In-sha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.



Saturday, March 2, 2013

Master Notes for problems in Oracle

In the name of Allah, Most Gracious, Most Merciful

In this post i am planning to pile up Master Notes for different problems in Oracle, so that when problem comes, i can quickly have access to them.

Oracle Database Corruption

Master Note for Handling Oracle Database Corruption Issues [ID 1088018.1]
How to Format Corrupted Block Not Part of Any Segment [ID 336133.1]


Tuesday, February 26, 2013

How to setup sudo on Oracle Solaris 10


In the name of Allah, Most Gracious, Most Merciful

sudo program executes a command with super user privileges with out login with super user. su command do the same but requires to login with super user. In this article i will describe to install and configure sudo packages on Oracle Solaris 10.

You need to have following packages to properly install sudo program. I assumed fresh Oracle Solaris 10 installed which don't have following packages installed.


You can get stable (or latest) releases of these packages from this website. you can use pkginfo command to check if these packages are already installed on your system.

pkginfo SMClinconv

You can install the above packages by transferring these packages to Solaris system and then switch to root user.

su - root
gunzip libiconv-1.9.2-sol10-x86-local.gz
pkgadd -d libiconv-1.9.2-sol10-x86-local

gunzip libgcc-3.4.6-sol10-x86-local.gz
pkgadd -d libgcc-3.4.6-sol10-x86-local

gunzip libintl-3.4.0-sol10-x86-local.gz
pkgadd -d libintl-3.4.0-sol10-x86-local

gunzip sudo-1.8.3p2-sol10-x86-local.gz
pkgadd -d sudo-1.8.3p2-sol10-x86-local

respond with "add" and "y" to questions asked by pkgadd program.

Now you can create symbolic link for sudo program
ln -s /usr/local/etc/sudoers /etc/sudoers
ln -s /usr/local/bin/sudo /bin/sudo
ln -s /usr/local/bin/sudoedit /bin/sudoedit 
Now last thing is to add privileged users to /etc/sudoers
This file has 0440 privileged so you need make is writable to add users.
chmod 0777 /etc/sudoers
vi /etc/sudoers
##
## User privilege specification
##
root ALL=(ALL) ALL
oracle ALL=(ALL) ALL 
now save and change file privileges to 0440 by using following command
chmod 0440 /etc/sudoers
Now exit from root and verify command by following method
/bin/sudo -u root /usr/sbin/ping localhost
If everything is write you will see response 
localhost is alive
if some library missing error you can see which library is missing by using
following command with root user
ldd /bin/sudo
you will see some (file not found) errors. note library name and download the
packages and use the above method to install missing packages.

Installation and Configuration of sudo program completes. Insha-Allah this will
help and serve the purpose. For any corrections and improvements please suggest.


Sunday, February 24, 2013

How to add default Route to Oracle Solaris 10

In the name of Allah, Most Gracious, Most Merciful. 
In this article I will describe the configuration command to add default Router temporally and permanently to Oracle Solaris 10.

You can see currently configured routes by following command

netstat -nr

You can delete currently configured default Route by following command

route delete default 192.168.10.251

You can add default router temporarily by following command

route add default 192.168.10.249

You can add default router permanently by following commands

route -p add default 192.168.10.249

Or

echo 192.168.10.249 > /etc/defaultrouter

It will create /etc/defaultrouter file if not already available. Next time you restart you system 192.168.10.249 will be automatically added to default router.


Insha-Allah this will help and serve the purpose. For any corrections and improvements please suggest.