Supraja DevOps Interview Preparation
Supraja DevOps Interview Preparation
I have been working with Applaud for over 3.5 years as a Consultant. To give a small brief about
Applaud, We are a product based company providing HR related services to our clients. As a
cloud consultant, my responsibilities include maintaining the complete infrastructure to
support our Application.
We provisioned the infrastructure using AWS which we are using as our cloud provider. And we
have used all the main various services like EC2, Load balancer, Auto scaling, Route 53, S3,
CloudFront, Cloudwatch, ElasticCache.
We have clients all over the world and henceforth our infrastructure is provisioned in a multi
region which is setup with high fault tolerance and scalable to handle millions of requests.
We automated our infrastructure provisioning with Terraform which is the primary IaC tool
Coming to our Application code , it is maintained completely in the Github and this is the
primary VCS tool for our organization.
I also own 2 certifications: AWS Certified Solutions Architect Associate, Hashicorp CTA
Apart from this, in my self-interest I also worked on a React project and built my own
application using the live-swiggy api that displays all the restaurant related information using
key concepts of React.
TeamCity:
Teamcity is used as the CI/CD tool integrated with Github to run various builds and pipelines as
part of daily development operations. Below are some of the builds that are run in the
Teamcity:
To brief one such pipeline in Teamcity, we have integrated teamcity with the SonarQube:
SonarQube is a 3rd party tool we’re using as a Code Coverage tool to analyze the code, and to
detect the no.of bugs, code duplication, check the quality of a code. It’s integrated with
teamcity and whenever the builds are triggered it analyzes the code based on the script and
pushes back the report to github. It ensures that the code meets specific quality standard
before integrating into the main DB
So as part of end to end testing, we have another build in TeamCity, that performs the end to
end tests for which we are using the GhostInspector tool. We have all the testcases that are
created in the GhostInspector. And as part of this pipeline, it sets up a new dev-like
environment where all the tests are run and a report will be generated to the developer.
Nightly builds:
And as default, the merge button will be disabled in Github and once all the tests are
succeeded, the merge will be enabled and code will be merged to the development branch .
As part of deploying changes to the staging, we have Nightly build in Teamcity. In this, we pull
all the latest changes that were merged into the development branch recently and deploy those
into the staging environment and restart all the services. This way we will ensure all the latest
changes are deployed into the staging environment every day.
Deployment steps:
About env.json
We have different environments like stage, tryapplaud, production. And we have a separate
env.json file for each environment using which our code base refers to connect to aws, mongo
atlas and to refer to other global environment specific variables.
Now during deployment, we have an init script that creates env.json after instance creation and
starts all the services from the launch template.
Explain more about TeamCity and how efficiently are you handling the builds?
It’s a powerful CI/CD server which automates the building, testing, and deploying of software
projects.
We’re having multiple builds. Ex: To run E2E tests, to run unit test cases, and other builds etc
Apart from the Default Agent, we created another Agent pool in which we provide a launch
template with all details like AMI, no.of instances and the idle threshold limit is 30 mins i.e, if a
build remains idle for 30 mins, then it gets terminated and if new build gets triggered, another
instance gets created. When developers raises multiple PRs and the build triggers, if all the
builds in that Agent Pool are busy then it waits in the queue until the build completes its
execution or if the earlier request is completed in less time, then the next request instead of
going into the queue utilizes the current instance
What’s the advantage of maintaining multiple Agent Pools and multiple build agents?
An Agent Pool with multiple build agents can process multiple requests instead of sending to
queue and thus saving time
NAT gateway is placed in the public subnet, so that servers in the private subnet can be secured
from the internet and in this way, instances in the private subnet can download the packages
from the internet securely without exposing to the outer world
AWS Infrastructure:
Nginx:
It’s a high performance web server, reverse proxy server and load balancer. It’s mainly used for
serving static content, handling requests from web clients and distributing the load across
multiple servers
NLB: It operates at layer 4(Transport layer) and distributes TCP/UDP traffic. It can be a
hardware device or a cloud-based service to distribute the network traffic at transport layer
Nginx: It operates at layer 7(Application layer) and routes Http, Https and other protocols based
on the content(URL headers).. It runs as a software on a server and processes various tasks such
as caching, reverse proxy, ssl termination, load balancing.
What is Nginx’s role in enabling Load Balancing, SSL Enabling & Reverse Proxying:
1. Load balancing: Nginx can distribute incoming client requests across multiple backend
servers, preventing any single server from becoming overloaded. The algorithms used
are Round robin, Least connections, IP Hash, Weighted load balancing
2. SSL/TLS Termination: Nginx can handle SSL/TLS encryption and decryption, freeing up
backend servers from this CPU-intensive task. SSL termination also enables Nginx to
perform tasks such as HTTPS redirection
3. Reverse Proxy: Nginx acts as an intermediary for requests from clients seeking resources
from backend servers. This allows Nginx to
Hide the identity of backend servers
Distribute traffic efficiently to multiple servers
Enhance security by preventing direct access to backend servers
● The NLB distributes traffic to Nginx instances, which perform Layer 7 load balancing, SSL
termination, and reverse proxying.
● Nginx handles complex routing and security tasks before passing requests to the
application servers.
● Nginx forwards requests to an ALB, which then directs traffic to the appropriate
application servers.
● This setup ensures that the application servers are not exposed directly to the internet,
enhancing security by restricting public access.
● The ALB in the private subnet ensures that traffic is managed internally, with no direct
exposure to the internet.
How does Nginx act as a reverse proxy and route request and which algorithms does it
follow?
Nginx can distribute client requests to backend servers based on various load-balancing
algorithms. These algorithms determine how requests are distributed among the available
backend servers or load balancers:
● Round Robin: Distributes requests sequentially across all available servers. This is the
default method in Nginx.
● Least Connections: Sends requests to the server with the fewest active connections.
This is useful when backend servers have varying workloads.
● IP Hash: Routes requests from a particular client IP address to the same backend server.
This ensures session persistence (sticky sessions) without requiring additional session
management.
● Least Time: Chooses the server with the least average response time and the fewest
active connections. This requires the Nginx Plus module.
● Random with Two Choices: Randomly selects two servers and then picks the one with
fewer active connections.
The most used algorithm to handle the load when there are huge no.of parallel requests is
Least connections. Here is the schema of the nginx config file
Dynamic Load Distribution: It dynamically distributes requests to the server with the fewest
active connections at the time the request is received. This ensures that no single server
becomes a bottleneck, especially when the servers have varying capacities or workloads.
Better Resource Utilization: In environments where backend servers have different processing
capabilities or where requests have different processing times, Least Connections ensures that
more powerful servers or those with lighter loads receive more requests, optimizing overall
resource utilization.
Handles Traffic Spikes Efficiently: During periods of high traffic, Least Connections is effective in
balancing the load across servers, reducing the risk of overloading any single server. This is
crucial when handling a large number of parallel requests.
Resiliency to Uneven Traffic: If some requests take longer to process than others (e.g., due to
heavy computation or I/O operations), Least Connections prevents servers with longer-running
requests from being overwhelmed by distributing new requests to servers that are less busy.
Redis cluster:
It’s an in-memory store that enhances performance by caching data, reducing latency, and
handling high throughput. It scales easily by distributing data across multiple nodes, balancing
the load, and ensuring fault tolerance through automatic failover and data replication.
Branching strategies:
It’s a strategy used in software development and deployment to minimize downtime and
reduce risks when releasing new versions of an application. It involves maintaining 2 identical
Prod environments: “blue” and “green”
2. Deployment Process:
Step 1: The new version of the application is deployed to the green environment, while
the blue environment continues to serve production traffic.
Step 2: After deployment, testing is performed on the green environment to ensure that
everything is functioning correctly.
Step 3: Once the green environment is verified, the traffic is switched from the blue
environment to the green environment, making the green environment live.
Step 4: The blue environment remains intact as a backup. If any issues are found in the
green environment after the switch, the traffic can be quickly switched back to the blue
environment.
3. Benefits:
Zero Downtime: Because the traffic can be switched instantly, users experience no
downtime during the deployment process.
Easy Rollback: If something goes wrong with the new deployment, it’s easy to revert to
the previous version by switching traffic back to the blue environment.
Improved Testing: Since the new version is deployed to a separate environment, it
allows thorough testing before it goes live.
Example: We have an ASG that uses the launch templates and currently the latest version of the
LT is 70 and is having R-12 code with 2 servers and this is the blue env. Now, you need to
release a new version with additional features. So, from the base server you’ll create a new AMI
which has R-13 code and update the LT with the latest AMI and set the default version to 71
and add 2 more new servers and once all these servers are healthy, we then remove the old
servers and now this is green env. If we find any issues again, we can then set the LT version to
70 and add 2 servers; it runs as usual with the oldest code.
Example: We have a standalone base server with all dependencies and software installed
required for our application. Whenever there is a new release to be deployed, we checkout
that branch in the base server and create a new AMI from the base server.
This way we have different AMI’s available for each Release version. For a new release, we just
update the corresponding AMI in the launch template and create a new Launch Template
version and rotate the servers. (add 2 servers and delete the earlier 2 servers)
Incase of any issues with deployment, we just flip the launch template to its earlier version
(which has the previous release AMI) and rotate the servers again.
● What it is: ECS is a fully managed container orchestration service by AWS, used to run
and manage containers (like Docker containers) on a cluster of EC2 instances or with
AWS Fargate.
● Purpose: It helps you run, stop, and manage Docker containers in a cluster, handling
container scheduling, scaling, and deployment.
● Key Features:
○ Task Definitions: Defines which Docker containers to run.
○ Clusters: A logical grouping of EC2 instances (or Fargate tasks) where the
containers run.
○ Service: Ensures the desired number of task definitions are running.
○ Scaling: Automatically scales the number of tasks or services based on demand.
● Use Case: Ideal for running microservices or distributed applications in a containerized
environment.
● What it is: ECR is a fully managed Docker container registry that allows developers to
store, manage, and deploy Docker container images in a secure and scalable way.
● Purpose: ECR stores Docker images, which can be pulled by ECS (or other container
services) to deploy containers.
● Key Features:
○ Private Repositories: Secure storage for Docker images.
○ Image Versioning: Tracks versions of container images.
○ Integration with ECS: Seamlessly integrates with ECS to pull container images for
deployment.
○ IAM Security: Uses AWS Identity and Access Management (IAM) to control
access to your images.
● Use Case: Useful for storing container images that will be used by ECS, Kubernetes, or
other container platforms.
ECS runs your containers, and ECR stores the container images required by ECS.
For example, you would build a Docker image for your application, push it to ECR, and then
configure ECS to pull that image from ECR to run it as a service or task.
Route53:
It’s a scalable and highly available DNS web service. It translates domain names like
(www.example.com) into IP addresses that computers use to connect to each other. It can
route to different AWS services like S3 buckets, AWS instances.
A DNS record in a hosted zone tells Route 53 how you want to route traffic for a domain or
subdomain. The most common types of records are:
Use cases Used for providing an Best for distributing Ideal for microservices
additional layer of traffic to ensure that no architecture where you
abstraction and single server is need fine-grained control
managing various overloaded & enhance over API interactions &
server-side functions fault tolerance security
Key features -> Threat detection -> Automated -> Sensitive data
-> Continuous security assessments discovery
monitoring -> Security standards -> Data privacy
-> Integrated -> Assessment -> Continuous
intelligence reports monitoring
Purpose It records API calls made on your It tracks and records the config of
AWS account. It provides visibility AWS resources over time. It
into user activity, such as who enables to assess, audit, and
made a request, what actions were evaluate the config of AWS
taken, and when and from where resources to ensure they comply
they were made. It focuses on with desired configs and standards
logging & auditing
1. Enable CloudTrail Logging: Go to the AWS CloudTrail console and create a new trail. Store the
logs in an S3 bucket with appropriate permissions and encryption.
2. Set Up AWS Config for Compliance Monitoring: Enable AWS Config to track the configuration
changes of your AWS resources and define compliance rules in AWS Config to check whether
your resources are configured according to best practices (e.g., S3 buckets should be
encrypted).
3. Integrate with Amazon CloudWatch for Real-Time Monitoring: Use Amazon CloudWatch
Logs to monitor CloudTrail logs. Set up filters for specific events (e.g., unauthorized API calls,
root account usage). Create CloudWatch Alarms based on these filters. For example, trigger an
alarm if there is an IAM:DeleteUser action.
Ex: We’ll set up a Metric filter with “IAM:DeleteUser”, and if this pattern is found in the log
group, we can create a custom metric and assign it a value. if it meets the condition then we
know that some anomaly is detected and trigger an alarm
4. Automate Responses with AWS Lambda: Configure AWS Lambda functions to respond
automatically to CloudWatch Alarms. For example, a Lambda function can automatically revoke
permissions if a security violation is detected.
5. Set Up Alerts with Amazon SNS: Integrate CloudWatch Alarms with Amazon SNS to send
immediate alerts (via email, SMS, or other messaging services) when a security or compliance
violation is detected.
It protects your web application or APIs from common web exploits and bots that can affect
availability, compromise security, or consume excessive resources.
Key Features of AWS WAF:
CloudFront is a Content Delivery Network (CDN) that delivers your content globally with low
latency and high transfer speed. When integrated with AWS WAF, CloudFront acts as the entry
point for incoming requests, applying both security rules(WAF) and performance optimizations.
So, when a user makes any request for the content stored in S3 bucket, request is routed to
Nginx server and this forwards the request to ALB which determines the appropriate backend
service, which could be S3. CloudFront comes into play, when ALB forwards the request to S3
bucket, assuming CloudFront is configured as the CDN for that bucket. Once CLoudFront
validates and processes the request, it forwards to S3 bucket. If the request passes all
validations, CloudFront retrieves the requested content from S3 and caches it if needed.
CloudFront then returns the response to ALB, which passes it back through Nginx to the user.
It enables you to capture information about the IP traffic going to and from network interfaces
within your Virtual Private Cloud (VPC). These logs capture details such as the source and
destination IP addresses, protocols, ports, and other relevant information about the traffic
flowing through your VPC.
● Traffic Monitoring: Captures details about both accepted and rejected traffic based on
your security group and network ACL (Access Control List) rules.
● Granularity: Can be created at different levels of granularity—VPC, subnet, or network
interface level.
● Log Storage: The logs are stored in Amazon CloudWatch Logs or sent to an S3 bucket for
analysis and long-term storage.
● Filtering: You can filter the logs based on specific parameters (like specific IP addresses
or ports) to reduce the amount of data captured.
● No Impact on Network Performance: Enabling VPC Flow Logs does not affect the
performance of your network or the latency of your applications.
It’s a security management service that provides a centralized view of your AWS env’s security
posture. It aggregates, organizes and prioritizes security findings from multiple AWS services
and 3rd party security products. By providing automated security checks, Security Hub helps
you identify and remediate potential security issues across your AWS environment.
Amazon EventBridge:
It’s a serverless event bus service that enables you to build event-driven architectures by
connecting different AWS services, custom applications and 3rd party SaaS applications using
events OR we can also configure scheduled triggers . It extends the capabilities of CloudWatch
events by offering better integration options.
Lambda function:
MongoDB:
MongoDB is a popular NoSQL database designed for scalability, flexibility and performance.
Unlike traditional relational databases that use tables and rows, it stores data in flexible JSON-
like documents.
Documents are grouped into collections. A collection in MongoDB is similar to a table in
RDBMS. Documents within a collection can be various shapes and sizes. It can support indexing
on any field within the documents, which improves the query performance.
As we’re using Redis as a caching layer and it supports NoSQL databases and also it’s a
preferable database for our dev team as well, we’re using MongoDB
Why MongoDB is preferred over DocumentDB(even though it supports MongoDB) in AWS
1. Feature completeness: MongoDB Atlas provides full compatibility with the latest
MongoDB features, including advanced query operators, transactions whereas
DocumentDB supports offers only partial compatibility and lacks support for MongoDB
features.
2. Deployment flexibility: MongoDB Atlas allows multi-cloud and multi-region deployments
across AWS, GCP, Azure offering more flexibility with automatic failover whereas
Amazon DocumentDB is limited to AWS and lacks these multi-cloud features.
3. Developer experience and ecosystem: MongoDB Atlas offers a rich developer
experience with support for advanced querying whereas DocumentDB has more limited
querying capabilities.
What is VPC Peering and How peering is setup between AWS application servers and
MongoDB
● AWS VPC: Identify the VPC where your application servers are hosted.
● MongoDB VPC: Identify the VPC where your MongoDB instances are hosted. If using
MongoDB Atlas, Atlas creates a VPC in your chosen cloud provider (AWS in this case).
● Update the security groups in both VPCs to allow traffic between the application servers
and MongoDB.
● Application Servers:
○ Add inbound rules to allow traffic from the MongoDB VPC’s CIDR block on the
necessary ports (e.g., port 27017 for MongoDB).
● MongoDB Instances:
○ Similarly, add inbound rules to allow traffic from the application VPC’s CIDR
block.
● Verify that your application servers can connect to the MongoDB instances.
● You can do this by trying to connect to MongoDB from an application server or by using
a tool like mongo shell or mongosh from the command line.
Terraform:
How do you perform terraform migration?
Let’s assume the entire infra is created manually and from now, it should be managed through
Terraform. Below are the steps to migrate it to terraform
1) Create a main.tf file
provider “aws” {
region = “us-east-1”
}
import {
id = “instance_id”,
to = “aws_instance.example”
}
2) $terraform init
3) $terraform plan -generate-config-out=”generated_resources.tf”
4) generated_resources.tf file will be generated which contains the infra resources that
were created manually
5) Copy entire file and replace it in main.tf file and also remove the import block
6) $terraform plan - it still shows there is 1 resource that needs to be created manually
even though we imported from AWS console. This is because state file isn’t created yet
7) To create state file, $terraform import aws_instance.example <instance_id>
8) $terraform plan & $terraform apply will work fine and from now, all resources can be
managed through terraform
Drift detection
There might be scenarios when a person is leaving the org, he may mess up things and how do
we handle those situations.
Suppose, our entire infra is managed through terraform and a person has manually changed
some config directly in AWS console which resulted in error in next operations. To handle these
situations: We can either do terraform refresh with cron expression which updates the state file
but it’s not a suggestible approach OR create lambda function such that it monitors for the
changes and immediately sends alerts whenever changes are made
State files can store sensitive info and if the code is uploaded to github, anyone who has the
access can view the file. Even if we restrict the access to the people, we have another problem
as: If a person wants to edit the code of terraform project, he then downloads the code from
github, performs edit, applies the changes, then the state file also gets updated with new
modifications. So, every time, the person has to push the state file to Github along with the
code changes. So here, the state file is updated only after “terraform apply”. But the problem
here is that, what if the person checks out the code from Github, updates the logic and he
doesn’t perform “terraform apply” and directly pushes back the code to github again and now
the state file doesn’t have the updated config. So now, when another person checks out the
code from github, it says that the state file and the main.tf file doesn’t match and asks to delete
the code.
So, to solve this problem we use the concept of Remote backend for ex: S3 bucket. The
terraform state file gets stored in S3 bucket and project code is stored in github repo.
Whenever the developer makes changes to the code and does “terraform apply”, the terraform
state file gets updated in S3 bucket.
To implement this, we can create an S3 bucket in the main.tf file and create a backend.tf file
and then include the S3 bucket name in this backend.tf file.
Similarly to implement locking mechanism, create a Dynamodb table in main.tf file and then
include the DynamoDB table in backend.tf file.
We have terraform code stored in Github and we maintain a global backend (s3 with
DynamoDB table for locking) to store the state file.
Now, the process of running init, plan and apply commands for terraform changes is
automated. Whenever a user raises a PR with code change, we trigger a build in the AWS Code
pipeline which setup terraform and runs init and plan commands and store the generated plan
to the s3 bucket.
The code changes and plan will be then reviewed and once the change is merged, another build
will be triggered which runs the apply command using the plan generated in the earlier build.
What are the challenges you faced and how did you overcome that?
In our Nginx server, in the properties.conf file we whitelist our client’s IP addresses such that
traffic will be allowed from only those IPs into our application. And also, in our NLB we maintain
static IP addresses in each availability zone and we give these static IP addresses to clients such
that they will only allow the traffic from these IP addresses.
So, recently we moved our Prod env from old VPC to new VPC to support broader IP address
range. After this activity is done, we noticed 2 issues:
1. Initially, our application was not at all accessible and on further debugging the issue was
in the NLB, we assigned new static IP and the client has old static IP. So, because of this
mismatch application wasn’t accessible and we updated the static IPs with the old ones
2. Even after doing this activity, application was accessible inconsistently and on further
debugging we noticed that the traffic isn’t distributed equally and because of this it was
accessible to few users and for few users, application was down. So, we fixed this issue
by enabling ‘Cross Zone load balancing’ so that the traffic will be distributed evenly to all
the availability zones.
SSL Termination with Nginx and Reverse Proxy configuration:
SSL Termination: Decrypts the SSL / TLS traffic at the Nginx server before passing the
unencrypted(plain text) traffic to the backend servers, such as application servers or load
balancers.
The main Nginx configuration file typically resides in /etc/nginx/nginx.conf. This file includes
global settings and can include the configuration files from sites-enabled.
2. Site Configuration Files in sites-enabled/ Directory
File: /etc/nginx/sites-enabled/wipo.applaudcloud-eu.com
The custom properties files contain configurations to use Nginx as a reverse proxy and route
requests to a load balancer based on URL patterns.
File: /etc/nginx/custom-properties/wipo-custom.conf
4. Explanation
● SSL Configuration:
○ SSL termination is handled by Nginx using the provided .pem files (fullchain.pem
for the certificate and privkey.pem for the private key).
○ SSL protocols and ciphers are defined to ensure secure communication.
● Reverse Proxy:
○ The proxy_pass directive routes the incoming requests to the specified load
balancer based on the URL patterns.
○ The headers like X-Real-IP, X-Forwarded-For, and X-Forwarded-Proto are
forwarded to the backend to preserve the client’s original information.
● Domain-Specific Custom Properties:
○ Separate custom properties files are used for each domain, allowing for domain-
specific routing rules and configurations.
5. Deployment Instructions
This setup will handle SSL termination at Nginx, route traffic to the appropriate backend load
balancers, and manage requests efficiently for all domains.
In AWS, we have AutoScaling feature to horizontally scale our servers as and when needed
according to the traffic. But in MongoDB, we don’t have that feature and everytime clusters
used to run at max capacity even when there is not much traffic. So, this used to increase our
costs and as an alternative approach, we wrote JavaScript functions so that the alarms will
trigger whenever the cluster size reaches to Dmax capacity for ex: 80, then the function will get
triggered and performs accordingly and reduces the cluster size to min capacity similar to Auto
scaling scale-in and scale-out features. In this way, we’re maintaining the cluster capacities
accordingly and eventually decreasing the cost.
Scripting interview questions:
2) What would happen if the list you're iterating over is empty? How would you handle that?
3) How would you modify the loop to handle an error condition, such as a missing file?
4) How would you extend this script to handle input from a user at runtime?
$ echo “Enter no.of iterations”
read num_iterations
for (( i=1;i<num_iterations;i++))
do
echo “Iteration - $i”
done
5) How do you implement error handling if the file you are searching for is not found?
3) How can you check if the correct number of arguments is passed to a script?
$0 means it prints name of the script
4) Can you pass an array to a Bash script, and how would you handle it?
What are some common string manipulation techniques in Bash?
What is the difference between $() and ${}?
How can you read a file line by line and process only lines that contain specific words?
line.strip() removes any leading & trailing whitespaces including any newline character
2nd way:
How would you modify the code to handle potential errors while reading the file?
Explain how you would schedule a cron job to run a script every day at 2am?
How do you handle errors in a bash script?
In this example, if any command fails the script exits automatically without executing
subsequent commands
Using trap to handle errors gracefully:
#!/bin/bash
while IFS=, read -r column1 column2 column3; do
echo “Column 1: $column1, Column 2: $column2, Column 3: $column3”
done < ${filename.csv}
How do you automate the deployment of applications to multiple servers?
Write a script to monitor disk usage and send alert if threshold exceeds 80%
Write a script to backup logs older than 7 days and delete original files
Write a script to automate DB backup
Write a script to update web application by pulling latest code from Github repo
Write a script to compress and archive old log files
Write a script to automate the cleanup of temporary files older than 10 days
Write a script to install list of packages
Write a script to check health of web application by sending Http request and check response
Write a script to automate the configuration of new server with necessary packages
Linux interview questions:
What is Linux?
What? It’s a file that points to another file It’s the direct reference to the
or directory by storing its path. It physical data on the disk(inode) of a
works like a shortcut in windows. file. It essentially creates another
name for the same file content.
Key features Points to the file’s path - A soft link Points to file’s data(inode) - A hard
contains path to the original file, not link points to file’s inode, means it
its actual data points directly to the same data as
Can link to directories - It can point the original file
to both files and directories Can’t link to directories - It can only
Broken link - If original file is deleted be created for files, not directories
or moved, soft link becomes a No broken link - Even if the original
broken link and won’t work file is deleted, the data remains
Size link - Takes little space as it accessible via any of its hard links
stores only the file path Size link - Same size as the original
file
Use cases You want to create a shortcut to the You want to create backup of a file
commonly accessed directory without actually duplicating the
located deep inside, or you need to data, and you want to ensure file
link across file systems content persists even if the original
file is deleted
systemd: It’s an init system and service manager for linux responsible for booting the system,
managing system services, handling dependencies and controlling system states.
systemctl: It’s a command-line utility used to interact with systemd to manage and control the
state of the system services and other units managed by systemd.
How systemctl Works at a Higher Level
● Service Management: systemctl allows you to manage services (start, stop, restart,
enable, disable, etc.). These services are typically defined by unit files, usually located in
/etc/systemd/system/ or /lib/systemd/system/. Each unit file describes how the service
should start, what it depends on, and other configurations.
● Fetching Status: When you run sudo systemctl status <service_name>, systemctl
queries the state of the service from systemd's internal data structures. systemd keeps
track of the status of all managed services, including whether they are running, stopped,
or failed, along with logs related to the service. systemctl fetches and displays this
information.
You need to create a new user and ensure they have no shell access. How would you do?